blob: 596b4ef598d775c9e812d7584237dfa20ecbdeaf [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<script src='../resources/runner.js'></script>
</head>
<body>
<script>
function runTest() {
navigator.serviceWorker.addEventListener('message', (msg) => {
PerfTestRunner.recordResultFromWorker(msg.data);
});
const script =
'/service_worker/resources/cache-has-service-worker.js';
const scope = '/service_worker/resources/';
navigator.serviceWorker.register(script, { scope: scope }).catch((error) => {
PerfTestRunner.logFatalError(
'Failed to register service worker script:' + script);
});
return;
}
PerfTestRunner.startMeasureValuesInWorker({
description: 'Measure performance of CacheStorage.has().',
unit: 'runs/s',
run: runTest
});
</script>
</body>
</html>