summaryrefslogtreecommitdiffstats
path: root/dom/performance/tests/sharedworker_performance_user_timing.js
blob: 6dcbd5d7d9557c44f4378cf43f775a1cd03f0ead (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
30
31
32
33
34
35
36
37
38
var port;

function ok(a, msg) {
  dump("OK: " + !!a + "  =>  " + a + " " + msg + "\n");
  port.postMessage({ type: "status", status: !!a, msg: a + ": " + msg });
}

function is(a, b, msg) {
  dump("IS: " + (a === b) + "  =>  " + a + " | " + b + " " + msg + "\n");
  port.postMessage({
    type: "status",
    status: a === b,
    msg: a + " === " + b + ": " + msg,
  });
}

function isnot(a, b, msg) {
  dump("ISNOT: " + (a === b) + "  =>  " + a + " | " + b + " " + msg + "\n");
  port.postMessage({
    type: "status",
    status: a != b,
    msg: a + " != " + b + ": " + msg,
  });
}

importScripts("test_performance_user_timing.js");

onconnect = function (evt) {
  port = evt.ports[0];

  for (var i = 0; i < steps.length; ++i) {
    performance.clearMarks();
    performance.clearMeasures();
    steps[i]();
  }

  port.postMessage({ type: "finish" });
};