Bumping manifests a=b2g-bump
[gecko.git] / dom / tv / test / mochitest / file_tv_get_sources.html
blobdd8010b8c946d2257ea0a385e1985a6174fea526
1 <!DOCTYPE HTML>
2 <html>
3 <head>
4 <meta charset="utf-8">
5 <title>Test GetSources for TV API</title>
6 </head>
7 <body>
8 <div id="content"></div>
9 <script type="application/javascript" src="./test_helpers.js"></script>
10 <script type="application/javascript;version=1.7">
12 ok('tv' in navigator, "navigator.tv should exist.");
14 navigator.tv.getTuners().then(
15 function(aTuners) {
16 ok(aTuners.length > 0, "Got at least 1 tuner.");
18 aTuners[0].getSources().then(
19 function(aSources) {
20 ok(aSources.length > 0, "Got at least 1 source.");
21 for (var i = 0; i < aSources.length; i++) {
22 var source = aSources[i];
23 ok(source instanceof TVSource, "Source " + i + " should be in the right type.");
24 ok('tuner' in source, "Source " + i + " should have a tuner.");
25 ok('type' in source, "Source " + i + " should have a type.");
26 ok('isScanning' in source, "Source " + i + " should have isScanning.");
27 ok(!source.isScanning,
28 "Source " + i + " should not be scanning by default.");
29 ok(!source.currentChannel,
30 "Source " + i + " should have no current channel by default.");
33 finish();
35 function(aError) {
36 ok(false, "Error occurred when getting sources: " + aError);
37 finish();
41 function(aError) {
42 ok(false, "Error occurred when getting tuners: " + aError);
43 finish();
47 </script>
48 </body>
49 </html>