OLD | NEW |
---|---|
(Empty) | |
1 <script src="../../resources/js-test.js"></script> | |
2 <script> | |
3 description("This test checks if accessing navigator.serviceWorker doesn't fail with invalid frame"); | |
4 | |
5 if (window.testRunner) { | |
6 testRunner.dumpAsText(); | |
dominicc (has gone to gerrit)
2014/03/31 04:52:09
I could be wrong, but isn't dumpAsText the default
kinuko
2014/03/31 12:33:05
I removed this as I've converted it to use w3c tes
| |
7 testRunner.setCanOpenWindows(); | |
dominicc (has gone to gerrit)
2014/03/31 04:52:09
Do you need separate windows? Why not just use an
kinuko
2014/03/31 12:33:05
Hmm, on my local env I keep failing to repro the c
| |
8 testRunner.waitUntilDone(); | |
9 } | |
10 | |
11 var callbackCount = 0; | |
12 function callback() { | |
13 ++callbackCount; | |
14 if (callbackCount == 100) { | |
15 debug("DONE"); | |
16 testRunner.notifyDone(); | |
17 return; | |
18 } | |
19 try { | |
20 // window.navigator is replaced with a new window's one, which could | |
21 // be now invalid. | |
22 var sw = navigator.serviceWorker; | |
23 } catch (error) {} | |
24 var w = window.open("x", "y"); | |
25 window.navigator = w.navigator; | |
26 setTimeout(callback, 1); | |
27 } | |
28 | |
29 setTimeout(callback, 1); | |
dominicc (has gone to gerrit)
2014/03/31 04:52:09
Why do it 100 times? Do you just need a strategic
kinuko
2014/03/31 12:33:05
Either with gc() or not I can't seem to reliably r
| |
30 </script> | |
OLD | NEW |