Bug 1527157 [wpt PR 15268] - Add test for contentDocument behaviour during parsing, a=testonly
authorJosh Matthews <josh@joshmatthews.net>
Tue, 19 Feb 2019 14:39:13 +0000
changeset 461178 ae47c9bc4af628e9143bbe8daced47c8f0016561
parent 461177 7224c725cf96a503e81edad4d038c86e0b688c26
child 461179 280b4d2466dd8a963e620016702dbd1194915f87
push id112159
push userjames@hoppipolla.co.uk
push dateTue, 26 Feb 2019 12:08:48 +0000
treeherdermozilla-inbound@20be3ebad986 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1527157, 15268
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1527157 [wpt PR 15268] - Add test for contentDocument behaviour during parsing, a=testonly Automatic update from web-platform-tests Verify that contentDocument is updated during nested browsing context document parsing. -- wpt-commits: ae6d56308684b97f30a01b455ce3eb205cba79aa wpt-pr: 15268
testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/content_document_changes_only_after_load_matures.html
testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/support/iframe-that-checks-contentDocument.html
--- a/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/content_document_changes_only_after_load_matures.html
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/content_document_changes_only_after_load_matures.html
@@ -3,19 +3,26 @@
 <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();
+    var checkedDuringParse = false;
+    iframe.onload = t.step_func_done(function() {
+        testContentDocument();
+        assert_true(checkedDuringParse);
+    });
+
+    let url = "support/iframe-that-checks-contentDocument.html";
+    window.testContentDocument = t.step_func(function() {
+        assert_true(iframe.contentDocument.location.toString().includes(url));
+        checkedDuringParse = true;
     });
 
     assert_equals(iframe.contentDocument.location.toString(), "about:blank");
-    iframe.src = "support/blank.htm?pipe=trickle(d2)";
+    iframe.src = url + "?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>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/support/iframe-that-checks-contentDocument.html
@@ -0,0 +1,3 @@
+<script>
+  parent.testContentDocument();
+</script>