tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

fetch-error.https.html (1072B)


      1 <!DOCTYPE html>
      2 <html>
      3 <head>
      4 <script src="/resources/testharness.js"></script>
      5 <script src="/resources/testharnessreport.js"></script>
      6 <script src="/service-workers/service-worker/resources/test-helpers.sub.js"></script>
      7 </head>
      8 <body>
      9 <script>
     10 const scope = "./resources/in-scope";
     11 
     12 promise_test(async (test) => {
     13    const registration = await service_worker_unregister_and_register(
     14        test, "./resources/fetch-error-worker.js", scope);
     15    promise_test(async () => registration.unregister(),
     16                 "Unregister service worker");
     17    await wait_for_state(test, registration.installing, 'activated');
     18 }, "Setup service worker");
     19 
     20 promise_test(async (test) => {
     21    const iframe = await with_iframe(scope);
     22    test.add_cleanup(() => iframe.remove());
     23    const response = await iframe.contentWindow.fetch("fetch-error-test");
     24    return promise_rejects_js(test, iframe.contentWindow.TypeError,
     25                              response.text(), 'text() should reject');
     26 }, "Make sure a load that makes progress does not time out");
     27 </script>
     28 </body>
     29 </html>