summaryrefslogtreecommitdiffstats
path: root/dom/network/tests/worker_network_basics.js
blob: 25e8c5dd8e81dee262962c4404bf1f452caae791 (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 ok(a, msg) {
  postMessage({ type: "status", status: !!a, msg });
}

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

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

ok("connection" in navigator, "navigator.connection should exist");

ok(navigator.connection, "navigator.connection returns an object");

ok(
  navigator.connection instanceof EventTarget,
  "navigator.connection is a EventTarget object"
);

ok("type" in navigator.connection, "type should be a Connection attribute");
is(
  navigator.connection.type,
  "none",
  "By default connection.type equals to none"
);
finish();