mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
a79f77fa4f
--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
69 lines
2.0 KiB
HTML
69 lines
2.0 KiB
HTML
<!DOCTYPE HTML>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>Test channel scanning complete 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.");
|
|
|
|
var isScannedEventFired = false;
|
|
|
|
navigator.tv.getTuners().then(
|
|
function(aTuners) {
|
|
ok(aTuners.length > 0, "Got at least 1 tuner.");
|
|
|
|
aTuners[0].getSources().then(
|
|
function(aSources) {
|
|
ok(aSources.length > 0, "Got at least 1 source.");
|
|
var source = aSources[0];
|
|
|
|
source.oneitbroadcasted = function(aEvent) {
|
|
info("Received EIT broadcasted event.");
|
|
|
|
var programs = aEvent.programs;
|
|
for (var i = 0; i < programs.length; i++) {
|
|
ok(programs[i], "Program " + i + " should be set.")
|
|
}
|
|
};
|
|
|
|
source.onscanningstatechanged = function(aEvent) {
|
|
if (aEvent.state === 'scanned') {
|
|
isScannedEventFired = true;
|
|
info("Received channel scanned event.");
|
|
ok(aEvent.channel, "Scanned channel should be set.");
|
|
} else if (aEvent.state === 'completed') {
|
|
ok(isScannedEventFired, "Received channel scanning completed event after channel scanned event.");
|
|
finish();
|
|
}
|
|
};
|
|
|
|
// TODO Bug 1088818 - Modify the behavior of channel scanning.
|
|
source.startScanning({}).then(
|
|
function() {},
|
|
function(aError) {
|
|
ok(false, "Error occurred when starting scanning: " + aError);
|
|
finish();
|
|
}
|
|
);
|
|
},
|
|
function(aError) {
|
|
ok(false, "Error occurred when getting sources: " + aError);
|
|
finish();
|
|
}
|
|
);
|
|
},
|
|
function(aError) {
|
|
ok(false, "Error occurred when getting tuners: " + aError);
|
|
finish();
|
|
}
|
|
);
|
|
|
|
</script>
|
|
</body>
|
|
</html>
|