Bug 1482935 [wpt PR 12437] - implement opener, disowning, a=testonly
authorServo WPT Sync <32481905+servo-wpt-sync@users.noreply.github.com>
Wed, 15 Aug 2018 09:58:52 +0000
changeset 486847 1b6a39d56f5b1f459c7b5971c3725fbc4e307e5b
parent 486846 4850d4f8a660ce867932fff4ee644c38f3069a51
child 486848 6b092327eb0df4253c114dbef3d11fad9cdec217
push id9719
push userffxbld-merge
push dateFri, 24 Aug 2018 17:49:46 +0000
treeherdermozilla-beta@719ec98fba77 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1482935, 12437
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 1482935 [wpt PR 12437] - implement opener, disowning, a=testonly Automatic update from web-platform-testsMerge pull request #12437 from web-platform-tests/sync_df0680bbaa28caf2f0b68a03d9d1fa7403ff5b02 Merge pull request #12437 from sync_df0680bbaa28caf2f0b68a03d9d1fa7403ff5b02 -- wpt-commits: 6b99d2ceaccd06623d74c470174317ea21c47c85 wpt-pr: 12437
testing/web-platform/meta/MANIFEST.json
testing/web-platform/tests/html/browsers/windows/auxiliary-browsing-contexts/opener-setter.html
testing/web-platform/tests/html/browsers/windows/auxiliary-browsing-contexts/resources/opener-setter.html
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -279951,16 +279951,21 @@
      {}
     ]
    ],
    "html/browsers/windows/auxiliary-browsing-contexts/resources/open-closer.html": [
     [
      {}
     ]
    ],
+   "html/browsers/windows/auxiliary-browsing-contexts/resources/opener-setter.html": [
+    [
+     {}
+    ]
+   ],
    "html/browsers/windows/browsing-context-names/resources/choose-_parent-001-iframe-1.html": [
     [
      {}
     ]
    ],
    "html/browsers/windows/browsing-context-names/resources/choose-_parent-002-iframe.html": [
     [
      {}
@@ -353444,16 +353449,22 @@
     ]
    ],
    "html/browsers/windows/auxiliary-browsing-contexts/opener-noreferrer.html": [
     [
      "/html/browsers/windows/auxiliary-browsing-contexts/opener-noreferrer.html",
      {}
     ]
    ],
+   "html/browsers/windows/auxiliary-browsing-contexts/opener-setter.html": [
+    [
+     "/html/browsers/windows/auxiliary-browsing-contexts/opener-setter.html",
+     {}
+    ]
+   ],
    "html/browsers/windows/auxiliary-browsing-contexts/opener-setter.window.js": [
     [
      "/html/browsers/windows/auxiliary-browsing-contexts/opener-setter.window.html",
      {}
     ]
    ],
    "html/browsers/windows/auxiliary-browsing-contexts/opener.html": [
     [
@@ -589049,16 +589060,20 @@
   "html/browsers/windows/auxiliary-browsing-contexts/opener-noopener.html": [
    "fff10248fedfcf7f10cb9ab64020566cd4fe6f97",
    "testharness"
   ],
   "html/browsers/windows/auxiliary-browsing-contexts/opener-noreferrer.html": [
    "f82aa6f0abe0d16a8b132e531d165988af0af99f",
    "testharness"
   ],
+  "html/browsers/windows/auxiliary-browsing-contexts/opener-setter.html": [
+   "85c52e0b42e19bdd78dda120320d66ddbb2103b4",
+   "testharness"
+  ],
   "html/browsers/windows/auxiliary-browsing-contexts/opener-setter.window.js": [
    "6d540ce97c94bff5845023098d0960d51dad62b4",
    "testharness"
   ],
   "html/browsers/windows/auxiliary-browsing-contexts/opener.html": [
    "5bbaee6a378c7cacca8a9c274da71c34809bf5da",
    "testharness"
   ],
@@ -589077,16 +589092,20 @@
   "html/browsers/windows/auxiliary-browsing-contexts/resources/no-opener.html": [
    "afd72f948d9128fdf2b3884570e36ed7a8ea36e2",
    "support"
   ],
   "html/browsers/windows/auxiliary-browsing-contexts/resources/open-closer.html": [
    "6f43a5188c790577c4a1a03da270317eedba0fb0",
    "support"
   ],
+  "html/browsers/windows/auxiliary-browsing-contexts/resources/opener-setter.html": [
+   "4112dae0cee66138a309b202a8d09d6b256c6d4d",
+   "support"
+  ],
   "html/browsers/windows/browsing-context-names/choose-_blank-001.html": [
    "a1416f2eb8437a8824a26a0e2e6aa6fdede37ffa",
    "testharness"
   ],
   "html/browsers/windows/browsing-context-names/choose-_blank-002.html": [
    "aba9d52ba097f19500fb8ffac352b36b5b8e8bbf",
    "testharness"
   ],
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/windows/auxiliary-browsing-contexts/opener-setter.html
@@ -0,0 +1,32 @@
+<!doctype html>
+<html>
+  <head>
+    <title>Auxiliary Browing Contexts: window.opener setter</title>
+    <script src="/resources/testharness.js"></script>
+    <script src="/resources/testharnessreport.js"></script>
+    <script src="/common/PrefixedLocalStorage.js"></script>
+  </head>
+  <body>
+    <div id="log"></div>
+    <script>
+    var prefixedLocalStorage;
+    setup(() => prefixedLocalStorage = new PrefixedLocalStorageTest());
+    async_test(t => {
+      t.add_cleanup(() => prefixedLocalStorage.cleanup());
+      prefixedLocalStorage.onSet('openerIsNull', t.step_func_done(e => {
+        assert_equals(e.newValue, 'true');
+      }));
+      window.open(prefixedLocalStorage.url('resources/opener-setter.html'),
+        'iShouldSetOpenerToNull');
+    }, 'Auxiliary browsing context created via `window.open` and setting `window.opener` to `null` should report `window.opener` `null`');
+    async_test(t => {
+      t.add_cleanup(() => prefixedLocalStorage.cleanup());
+      prefixedLocalStorage.onSet('openerIsTest', t.step_func_done(e => {
+        assert_equals(e.newValue, 'true');
+      }));
+      window.open(prefixedLocalStorage.url('resources/opener-setter.html'),
+        'iShouldSetOpenerToTest');
+    }, 'Auxiliary browsing context created via `window.open` and setting `window.opener` to `test` should report `test`');
+    </script>
+  </body>
+</html>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/windows/auxiliary-browsing-contexts/resources/opener-setter.html
@@ -0,0 +1,23 @@
+<!doctype html>
+<meta charset="utf-8">
+<html>
+<p>This window should set the window.opener attribute</p>
+<script src="/common/PrefixedLocalStorage.js"></script>
+<script>
+var prefixedLocalStorage = new PrefixedLocalStorageResource({
+  close_on_cleanup: true
+});
+function checkOpener () {
+  if (window.name == 'iShouldSetOpenerToNull') {
+    window.opener = null;
+    return prefixedLocalStorage.setItem('openerIsNull', window.opener === null);
+  }
+  if (window.name == 'iShouldSetOpenerToTest') {
+    window.opener = 'test';
+    return prefixedLocalStorage.setItem('openerIsTest', window.opener === "test");
+  }
+}
+</script>
+<body onload="checkOpener()">
+</body>
+</html>