gecko/dom/tv/test/mochitest/file_tv_get_tuners.html
Sean Lin a79f77fa4f Bug 1088310 - [Stingray] Add more tests to TV Manager API. r=ehsan
--HG--
rename : dom/tv/test/file_app.sjs => dom/tv/test/mochitest/file_app.sjs
rename : dom/tv/test/file_app.template.webapp => dom/tv/test/mochitest/file_app.template.webapp
rename : dom/tv/test/file_tv_non_permitted_app.html => dom/tv/test/mochitest/file_tv_non_permitted_app.html
rename : dom/tv/test/mochitest.ini => dom/tv/test/mochitest/mochitest.ini
rename : dom/tv/test/test_tv_non_permitted_app.html => dom/tv/test/mochitest/test_tv_non_permitted_app.html
2014-10-22 23:15:24 +08:00

39 lines
1.1 KiB
HTML

<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>Test GetTuners for TV API</title>
</head>
<body>
<div id="content"></div>
<script type="application/javascript" src="./test_helpers.js"></script>
<script type="application/javascript;version=1.7">
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.");
}
finish();
},
function(aError) {
ok(false, "Error occurred when getting tuners: " + aError);
finish();
}
);
</script>
</body>
</html>