11cb0ef41Sopenharmony_ci<!DOCTYPE html> 21cb0ef41Sopenharmony_ci<meta charset="utf-8"> 31cb0ef41Sopenharmony_ci<script src="/resources/testharness.js"></script> 41cb0ef41Sopenharmony_ci<script src="/resources/testharnessreport.js"></script> 51cb0ef41Sopenharmony_ci<script src="/service-workers/service-worker/resources/test-helpers.sub.js"></script> 61cb0ef41Sopenharmony_ci<script> 71cb0ef41Sopenharmony_ci'use strict'; 81cb0ef41Sopenharmony_ci 91cb0ef41Sopenharmony_ciconst kServiceWorkerUrl = 'resources/service-worker.js'; 101cb0ef41Sopenharmony_ciconst kIframeUrl = 'resources/service-worker-iframe.html'; 111cb0ef41Sopenharmony_ci 121cb0ef41Sopenharmony_ci// A dummy test so that we can use the test-helpers.sub.js functions 131cb0ef41Sopenharmony_ciconst test = async_test('service-worker'); 141cb0ef41Sopenharmony_ci 151cb0ef41Sopenharmony_ciasync function registerAndStart() { 161cb0ef41Sopenharmony_ci const reg = await service_worker_unregister_and_register( 171cb0ef41Sopenharmony_ci test, kServiceWorkerUrl, kIframeUrl); 181cb0ef41Sopenharmony_ci await wait_for_state(test, reg.installing, 'activated'); 191cb0ef41Sopenharmony_ci const iframe = await with_iframe(kIframeUrl); 201cb0ef41Sopenharmony_ci fetch_tests_from_window(iframe.contentWindow); 211cb0ef41Sopenharmony_ci add_completion_callback(() => iframe.remove()); 221cb0ef41Sopenharmony_ci iframe.contentWindow.postMessage('explicit trigger', '*'); 231cb0ef41Sopenharmony_ci return service_worker_unregister_and_done(test, kIframeUrl); 241cb0ef41Sopenharmony_ci} 251cb0ef41Sopenharmony_ci 261cb0ef41Sopenharmony_cionload = registerAndStart; 271cb0ef41Sopenharmony_ci 281cb0ef41Sopenharmony_ci</script> 29