Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(367)

Side by Side Diff: third_party/WebKit/LayoutTests/fast/serviceworker/access-container-with-invalid-context.html

Issue 2295653002: Use window.testRunner in if-clause (Closed)
Patch Set: a Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <div id="container"></div> 2 <div id="container"></div>
3 <script src="../../resources/testharness.js"></script> 3 <script src="../../resources/testharness.js"></script>
4 <script src="../../resources/testharnessreport.js"></script> 4 <script src="../../resources/testharnessreport.js"></script>
5 <script> 5 <script>
6 var test = async_test("This test checks if accessing navigator.serviceWorker doe sn't crash with invalid frame"); 6 var test = async_test("This test checks if accessing navigator.serviceWorker doe sn't crash with invalid frame");
7 7
8 if (testRunner) 8 if (window.testRunner)
9 testRunner.setCanOpenWindows(); 9 testRunner.setCanOpenWindows();
10 10
11 function callback() { 11 function callback() {
12 // At this time window.navigator may be replaced with a new iframe's one, 12 // At this time window.navigator may be replaced with a new iframe's one,
13 // which could be now invalid. 13 // which could be now invalid.
14 var sw = navigator.serviceWorker; 14 var sw = navigator.serviceWorker;
15 test.done(); 15 test.done();
16 } 16 }
17 17
18 test.step(function() { 18 test.step(function() {
19 var w = window.open("x", "y"); 19 var w = window.open("x", "y");
20 window.navigator = w.navigator; 20 window.navigator = w.navigator;
21 setTimeout(callback, 1); 21 setTimeout(callback, 1);
22 }); 22 });
23 </script> 23 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698