summaryrefslogtreecommitdiffstats
path: root/dom/presentation/tests/mochitest/file_presentation_non_receiver.html
blob: 1203523ac38ea28f91c17624b4a5807dcbd50a6a (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
39
40
41
<!DOCTYPE HTML>
<html>
<head>
  <meta charset="utf-8">
  <title>Test for B2G PresentationReceiver on a non-receiver page at receiver side</title>
</head>
<body>
<div id="content"></div>
<script type="application/javascript;version=1.7">

"use strict";

function is(a, b, msg) {
  alert((a === b ? 'OK ' : 'KO ') + msg);
}

function ok(a, msg) {
  alert((a ? 'OK ' : 'KO ') + msg);
}

function info(msg) {
  alert('INFO ' + msg);
}

function finish() {
  alert('DONE');
}

function testConnectionAvailable() {
  return new Promise(function(aResolve, aReject) {
    is(navigator.presentation.receiver, null, "navigator.presentation.receiver shouldn't be available in non-receiving pages.");
    aResolve();
  });
}

testConnectionAvailable().
then(finish);

</script>
</body>
</html>