OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <script src="/js-test-resources/js-test.js"></script> | 2 <script src="/js-test-resources/js-test.js"></script> |
3 <script src="../resources/test-helpers.js"></script> | |
4 <script> | 3 <script> |
5 window.jsTestIsAsync = true; | 4 window.jsTestIsAsync = true; |
6 description('Test that ServiceWorker and ServiceWorkerRegistration are not garba
ge collected prematurely'); | 5 description('Test that ServiceWorker and ServiceWorkerRegistration are not garba
ge collected prematurely'); |
7 var registrationObservation = null; | 6 var registrationObservation = null; |
8 var swObservation = null; | 7 var swObservation = null; |
9 var scope = base_path() + '../resources/gc'; | 8 var scope = 'gc'; |
10 | 9 |
11 if (!window.internals) { | 10 if (!window.internals) { |
12 testFailed('This test requires internals.observeGC'); | 11 testFailed('This test requires internals.observeGC'); |
13 finishJSTest(); | 12 finishJSTest(); |
14 } else { | 13 } else { |
15 setup(); | 14 setup(); |
16 } | 15 } |
17 | 16 |
18 function setup() { | 17 function setup() { |
19 var worker = '../resources/empty-worker.js'; | 18 var worker = '../resources/empty-worker.js'; |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 // The worker is 'redundant' but the registration holds a reference to it, | 79 // The worker is 'redundant' but the registration holds a reference to it, |
81 // so it shouldn't be collected yet. | 80 // so it shouldn't be collected yet. |
82 // FIXME: When crbug.com/398355 is fixed, register a new script URL and | 81 // FIXME: When crbug.com/398355 is fixed, register a new script URL and |
83 // once the new worker is activated, check that the old worker is gc'd. | 82 // once the new worker is activated, check that the old worker is gc'd. |
84 gc(); | 83 gc(); |
85 shouldBeFalse('registrationObservation.wasCollected'); | 84 shouldBeFalse('registrationObservation.wasCollected'); |
86 shouldBeFalse('swObservation.wasCollected'); | 85 shouldBeFalse('swObservation.wasCollected'); |
87 finishJSTest(); | 86 finishJSTest(); |
88 } | 87 } |
89 </script> | 88 </script> |
OLD | NEW |