summaryrefslogtreecommitdiffstats
path: root/dom/serviceworkers/test/fetch/fetch_worker_script.js
blob: 6eb0b18a77218365cc2ea89713628863339254da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
function my_ok(v, msg) {
  postMessage({ type: "ok", value: v, msg });
}

function finish() {
  postMessage("finish");
}

function expectAsyncResult() {
  postMessage("expect");
}

expectAsyncResult();
try {
  var success = false;
  importScripts("nonexistent_imported_script.js");
} catch (x) {}

my_ok(success, "worker imported script should be intercepted");
finish();

function check_intercepted_script() {
  success = true;
}

importScripts("fetch_tests.js");

finish(); //corresponds to the gExpected increment before creating this worker