5 <title>Test GetSources for TV API
</title>
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(
16 ok(aTuners.length
> 0,
"Got at least 1 tuner.");
18 aTuners[
0].getSources().then(
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.");
36 ok(false,
"Error occurred when getting sources: " + aError);
42 ok(false,
"Error occurred when getting tuners: " + aError);