Add test to make sure contentDocument is updated after load matures

This commit is contained in:
Connor Brewster 2017-05-12 11:21:40 -06:00
parent d004db95cf
commit 727e5b41f5
2 changed files with 31 additions and 0 deletions

View file

@ -331418,6 +331418,12 @@
{} {}
] ]
], ],
"html/semantics/embedded-content/the-iframe-element/content_document_changes_only_after_load_matures.html": [
[
"/html/semantics/embedded-content/the-iframe-element/content_document_changes_only_after_load_matures.html",
{}
]
],
"html/semantics/embedded-content/the-iframe-element/cross_origin_parentage.html": [ "html/semantics/embedded-content/the-iframe-element/cross_origin_parentage.html": [
[ [
"/html/semantics/embedded-content/the-iframe-element/cross_origin_parentage.html", "/html/semantics/embedded-content/the-iframe-element/cross_origin_parentage.html",
@ -570683,6 +570689,10 @@
"56df0cb79a1af927a0209c0bbbb5edb25ccaee5f", "56df0cb79a1af927a0209c0bbbb5edb25ccaee5f",
"testharness" "testharness"
], ],
"html/semantics/embedded-content/the-iframe-element/content_document_changes_only_after_load_matures.html": [
"46708fc218e559fba7049a36888a7c8a24c22672",
"testharness"
],
"html/semantics/embedded-content/the-iframe-element/cross_origin_child.html": [ "html/semantics/embedded-content/the-iframe-element/cross_origin_child.html": [
"a42082bb612b280eda5aa598ed750cfce3edd537", "a42082bb612b280eda5aa598ed750cfce3edd537",
"support" "support"

View file

@ -0,0 +1,21 @@
<!doctype html>
<meta charset="utf-8">
<title>Iframe's contentDocument should only change after its pending load has matured.</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<body></body>
<script>
async_test(function(t) {
var iframe = document.createElement("iframe");
document.body.appendChild(iframe);
iframe.onload = t.step_func(function() {
assert_true(iframe.contentDocument.location.toString().includes("support/blank.htm"));
t.done();
});
assert_equals(iframe.contentDocument.location.toString(), "about:blank");
iframe.src = "support/blank.htm?pipe=trickle(d2)";
// The location of the contentDocument should not change until the new document has matured.
assert_equals(iframe.contentDocument.location.toString(), "about:blank");
}, "contentDocument should only change after a load matures.");
</script>