mirror of
https://github.com/classilla/tenfourfox.git
synced 2025-01-23 03:32:39 +00:00
48 lines
1.4 KiB
HTML
48 lines
1.4 KiB
HTML
<!DOCTYPE HTML>
|
|
<html>
|
|
<head>
|
|
<title>Test GetTuners for TV API</title>
|
|
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
|
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
|
</head>
|
|
<body>
|
|
<p id="display"></p>
|
|
<div id="content" style="display: none"></div>
|
|
<pre id="test">
|
|
<script type="application/javascript" src="./head.js"></script>
|
|
<script type="application/javascript">
|
|
|
|
function runTest() {
|
|
ok('tv' in navigator, "navigator.tv should exist.");
|
|
|
|
navigator.tv.getTuners().then(
|
|
function(aTuners) {
|
|
ok(aTuners.length > 0, "Got at least 1 tuner.");
|
|
for (var i = 0; i < aTuners.length; i++) {
|
|
var tuner = aTuners[i];
|
|
ok(tuner instanceof TVTuner, "Tuner " + i + " should be in the right type.");
|
|
ok('id' in tuner, "Tuner " + i + " should have an ID.");
|
|
ok(tuner.getSupportedSourceTypes().length > 0,
|
|
"Tuner " + i + " should have supported source type(s).");
|
|
ok(!tuner.currentSource,
|
|
"Tuner " + i + " should have no current source by default.");
|
|
ok(!tuner.stream, "Tuner " + i + " should have no stream by default.");
|
|
}
|
|
|
|
SimpleTest.finish();
|
|
},
|
|
function(aError) {
|
|
ok(false, "Error occurred when getting tuners: " + aError);
|
|
SimpleTest.finish();
|
|
}
|
|
);
|
|
}
|
|
|
|
SimpleTest.waitForExplicitFinish();
|
|
prepareTest(runTest);
|
|
|
|
</script>
|
|
</pre>
|
|
</body>
|
|
</html>
|