Bug 1423412 P5 Fix race in about-blank-replacement.https.html popup test case. r=baku
authorBen Kelly <ben@wanderview.com>
Tue, 05 Dec 2017 20:45:23 -0500
changeset 395178 7750a46652fa83acc6b8cd3e3bee8f428d24bfd5
parent 395177 bd99f4732647f01441e5ca93d11b27e98592838b
child 395179 3a4eb91654b6d1be54a5861ff665947615338610
push id98024
push userbkelly@mozilla.com
push dateWed, 06 Dec 2017 01:45:29 +0000
treeherdermozilla-inbound@7750a46652fa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku
bugs1423412
milestone59.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 1423412 P5 Fix race in about-blank-replacement.https.html popup test case. r=baku
testing/web-platform/tests/service-workers/service-worker/resources/about-blank-replacement-popup-frame.py
--- a/testing/web-platform/tests/service-workers/service-worker/resources/about-blank-replacement-popup-frame.py
+++ b/testing/web-platform/tests/service-workers/service-worker/resources/about-blank-replacement-popup-frame.py
@@ -7,22 +7,25 @@ def main(request, response):
 
   return ([('Content-Type', 'text/html')], """
 <!doctype html>
 <html>
 <body>
 <script>
 function nestedLoaded() {
   parent.postMessage({ type: 'NESTED_LOADED' }, '*');
-  popup.close();
 }
 
 let popup = window.open('?nested=true');
 popup.onload = nestedLoaded;
 
+addEventListener('unload', evt => {
+  popup.close();
+}, { once: true });
+
 // Helper routine to make it slightly easier for our parent to find
 // the nested popup window.
 function nested() {
   return popup;
 }
 </script>
 </body>
 </html>