| <title>Test counting of third-party script imports in workers</title> |
| <script src="/js-test-resources/js-test.js"></script> |
| <script src="resources/util.js"></script> |
| <body onload="runTest()"> |
| testRunner.dumpResourceLoadStatistics(); |
| setEnableFeature(false, function() { |
| function receiveMessage(event) { |
| if (event.data.indexOf("PASS") === -1) |
| testFailed(event.data.replace("FAIL ", "")); |
| testRunner.statisticsNotifyObserver(); |
| switch (document.location.hash) { |
| if (window.testRunner && window.internals) { |
| testRunner.waitUntilDone(); |
| setEnableFeature(true, function() { |
| testRunner.installStatisticsDidScanDataRecordsCallback(finishTest); |
| document.location.hash = "LoadWorker"; |
| let w1 = new Worker("resources/worker-importing-localhost-script.js"); |
| w1.onmessage = receiveMessage; |
| w1.postMessage("shouldNotReceiveCookies"); |