Bug 1458569 [wpt PR 10778] - HTML: document.open() and the beforeunload event, a=testonly
authorAnne van Kesteren <annevk@annevk.nl>
Wed, 22 Aug 2018 13:17:28 +0000
changeset 490828 5e452420d498274a79b91e9a7281f83202066a95
parent 490827 7a308e5f78c2792c423ec0b5d7e6d6bbafdf230a
child 490829 a340f8012724273c45f236d0d2adb1e489008dfb
push id1815
push userffxbld-merge
push dateMon, 15 Oct 2018 10:40:45 +0000
treeherdermozilla-release@18d4c09e9378 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1458569, 10778
milestone63.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 1458569 [wpt PR 10778] - HTML: document.open() and the beforeunload event, a=testonly Automatic update from web-platform-testsHTML: document.open() and the beforeunload event (#10778) For https://github.com/whatwg/html/pull/3918. -- wpt-commits: eafe4bdb65ced7352e953ec35c06c3afa3d8125b wpt-pr: 10778
testing/web-platform/meta/MANIFEST.json
testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/beforeunload.window.js
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -364830,16 +364830,22 @@
     ]
    ],
    "html/webappapis/dynamic-markup-insertion/opening-the-input-stream/bailout-side-effects-xml.window.js": [
     [
      "/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/bailout-side-effects-xml.window.html",
      {}
     ]
    ],
+   "html/webappapis/dynamic-markup-insertion/opening-the-input-stream/beforeunload.window.js": [
+    [
+     "/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/beforeunload.window.html",
+     {}
+    ]
+   ],
    "html/webappapis/dynamic-markup-insertion/opening-the-input-stream/custom-element.window.js": [
     [
      "/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/custom-element.window.html",
      {}
     ]
    ],
    "html/webappapis/dynamic-markup-insertion/opening-the-input-stream/document.open-01.xhtml": [
     [
@@ -605385,16 +605391,20 @@
   "html/webappapis/dynamic-markup-insertion/opening-the-input-stream/bailout-side-effects-synchronous-script.window.js": [
    "59a750a85875b15a186073c797aa11b060539969",
    "testharness"
   ],
   "html/webappapis/dynamic-markup-insertion/opening-the-input-stream/bailout-side-effects-xml.window.js": [
    "b3ea1fdf75455616c0e47772b0403bf434f76d36",
    "testharness"
   ],
+  "html/webappapis/dynamic-markup-insertion/opening-the-input-stream/beforeunload.window.js": [
+   "1e2f891c1766bb1bcf37855476d952b09e4faab2",
+   "testharness"
+  ],
   "html/webappapis/dynamic-markup-insertion/opening-the-input-stream/custom-element.window.js": [
    "be646d15b803d3fbe583a38d4524ad36e1a9b5d1",
    "testharness"
   ],
   "html/webappapis/dynamic-markup-insertion/opening-the-input-stream/document.open-01.xhtml": [
    "974702ae8cbdbd45704d325d5d7e1e649535bd09",
    "testharness"
   ],
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/beforeunload.window.js
@@ -0,0 +1,18 @@
+// In an earlier version of the HTML Standard, document open steps had "prompt
+// to unload document" as a step. Test that this no longer happens.
+
+async_test(t => {
+  const frame = document.body.appendChild(document.createElement("iframe"));
+  t.add_cleanup(() => frame.remove());
+  frame.src = "/common/blank.html";
+  frame.onload = t.step_func(() => {
+    frame.contentWindow.onbeforeunload = t.unreached_func("beforeunload should not be fired");
+    frame.contentDocument.open();
+    t.step_timeout(t.step_func_done(() => {
+      // If the beforeunload event has still not fired by this point, we
+      // consider the test a success. `frame.remove()` above will allow the
+      // `load` event to be fired on the top-level Window, thus unblocking
+      // testharness.
+    }), 500);
+  });
+}, "document.open() should not fire a beforeunload event");