Skip to content

Commit

Permalink
Added tests for cross-origin iframe parentage.
Browse files Browse the repository at this point in the history
  • Loading branch information
Alan Jeffrey committed Jun 10, 2016
1 parent 3acb954 commit 07ea9e6
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/wpt/metadata/MANIFEST.json
Expand Up @@ -36042,6 +36042,12 @@
"url": "/html/semantics/embedded-content/the-iframe-element/change_parentage.html"
}
],
"html/semantics/embedded-content/the-iframe-element/cross_origin_parentage.html": [
{
"path": "html/semantics/embedded-content/the-iframe-element/cross_origin_parentage.html",
"url": "/html/semantics/embedded-content/the-iframe-element/cross_origin_parentage.html"
}
],
"html/semantics/embedded-content/the-iframe-element/same_origin_parentage.html": [
{
"path": "html/semantics/embedded-content/the-iframe-element/same_origin_parentage.html",
Expand Down
@@ -0,0 +1,6 @@
[cross_origin_parentage.html]
type: testharness
[Check the frame heriarchy 1]
expected: FAIL
[Check the frame heriarchy 2]
expected: FAIL
@@ -0,0 +1,12 @@
<script src="iframe_harness.js"></script>
<body>
<iframe src="cross_origin_grandchild.html"></iframe>
</body>
<script>
send_test_results({
"id": '79a52de8-4222-427e-92db-caec28e75f8e',
"parent": window.parent !== window,
"grandparent": window.parent.parent === window.parent,
"top": window.top === window.parent,
});
</script>
@@ -0,0 +1,11 @@
<script src="iframe_harness.js"></script>
<body>
</body>
<script>
send_test_results({
"id": '6c8da65d-2c5e-44ef-bb0b-b8b9849aab19',
"parent": window.parent !== window,
"grandparent": window.parent.parent !== window.parent,
"top": window.top === window.parent.parent,
});
</script>
@@ -0,0 +1,19 @@
<!doctype html>
<meta charset="utf-8">
<title>Check the frame heriarchy</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="iframe_harness.js"></script>
<body>
<iframe src="http://www1.web-platform.test:8000/html/semantics/embedded-content/the-iframe-element/cross_origin_child.html"></iframe>
</body>
<script>
get_test_results('bffa23ee-b45a-4e9a-9405-87ab437d5cfa');
get_test_results('79a52de8-4222-427e-92db-caec28e75f8e');
get_test_results('6c8da65d-2c5e-44ef-bb0b-b8b9849aab19');
send_test_results({
"id": 'bffa23ee-b45a-4e9a-9405-87ab437d5cfa',
"parent": window.parent === window,
"top": window.top === window,
});
</script>

0 comments on commit 07ea9e6

Please sign in to comment.