tor-browser

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

idlharness.https.any.js (1075B)


      1 // META: global=window,worker
      2 // META: script=/resources/WebIDLParser.js
      3 // META: script=/resources/idlharness.js
      4 // META: script=/service-workers/service-worker/resources/test-helpers.sub.js
      5 
      6 'use strict';
      7 
      8 // https://wicg.github.io/content-index/spec/
      9 
     10 idl_test(
     11  ['content-index'],
     12  ['service-workers', 'html', 'dom'],
     13  async (idl_array, t) => {
     14    // TODO: Handle other worker types.
     15    if (self.GLOBAL.isWindow()) {
     16      idl_array.add_objects({
     17        ServiceWorkerRegistration: ['registration'],
     18        ContentIndex: ['registration.index'],
     19      });
     20      self.registration = await service_worker_unregister_and_register(
     21          t, 'resources/sw.js', 'resources/does/not/exist');
     22      t.add_cleanup(() => registration.unregister());
     23    }
     24    else if (self.ServiceWorkerGlobalScope) {
     25      idl_array.add_objects({
     26        ServiceWorkerGlobalScope: ['self'],
     27        ServiceWorkerRegistration: ['registration'],
     28        ContentIndex: ['registration.index'],
     29        ContentIndexEvent: ['new ContentIndexEvent("type", {id: "foo"})'],
     30      });
     31    }
     32  }
     33 );