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