summaryrefslogtreecommitdiffstats
path: root/dom/xhr/tests/worker_temporaryFileBlob.js
blob: db40f72a8b373b0f82f44b0a43d5d18f5ea5ac52 (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
29
importScripts('common_temporaryFileBlob.js');

function info(msg) {
  postMessage({type: 'info', msg: msg});
}

function ok(a, msg) {
  postMessage({type: 'check', what: !!a, msg: msg});
}

function is(a, b, msg) {
  ok(a === b, msg);
}

function next() {
  postMessage({type: 'finish'});
}

onmessage = function(e) {
  if (e.data == 'simple') {
    test_simple();
  } else if (e.data == 'abort') {
    test_abort();
  } else if (e.data == 'reuse') {
    test_reuse();
  } else {
    ok(false, 'Something wrong happened');
  }
}