summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/fetch/connection-pool/resources/network-partition-worker.js
blob: 1745edfacb130f5a0c177296fa6324acc45ab9f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// This tests the partition key of fetches to subresouce_origin made by the worker and
// imported scripts from subresource_origin.
importScripts('SUBRESOURCE_PREFIX:&dispatch=fetch_file&path=common/utils.js');
importScripts('SUBRESOURCE_PREFIX:&dispatch=fetch_file&path=resources/testharness.js');
importScripts('SUBRESOURCE_PREFIX:&dispatch=fetch_file&path=fetch/connection-pool/resources/network-partition-key.js');

async function fetch_and_reply() {
  try {
     await check_partition_ids();
     self.postMessage({result: 'success'});
  } catch (e) {
    self.postMessage({result: 'error', details: e.message});
  }
}
fetch_and_reply();