2012-06-22 00:37:49 -07:00
|
|
|
<!DOCTYPE HTML>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<title>Test Permitted Application for Alarm 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">
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
SimpleTest.waitForExplicitFinish();
|
|
|
|
|
|
|
|
SpecialPowers.pushPrefEnv({"set": [["dom.mozAlarms.enabled", true]]}, function() {
|
|
|
|
SpecialPowers.addPermission("alarms", true, document);
|
|
|
|
|
2014-06-12 23:19:11 -07:00
|
|
|
// mozAlarms is installed on all platforms except Android for the moment.
|
2012-06-22 00:37:49 -07:00
|
|
|
if (navigator.appVersion.indexOf("Android") != -1) {
|
2014-06-12 23:19:11 -07:00
|
|
|
ok('AlarmsManager' in window, "Interface AlarmsManager should exist");
|
|
|
|
try {
|
|
|
|
todo('mozAlarms' in navigator,
|
|
|
|
"mozAlarms is not allowed on Android for now. TODO Bug 863557.");
|
|
|
|
} catch (e) {
|
|
|
|
todo(!e, "('mozAlarms' in navigator) should not throw exceptions once " +
|
|
|
|
"mozAlarms is installed on Android. TODO Bug 863557. " +
|
|
|
|
"Caught exception: " + e);
|
|
|
|
}
|
2012-06-22 00:37:49 -07:00
|
|
|
} else {
|
|
|
|
ok('mozAlarms' in navigator, "navigator.mozAlarms should exist");
|
2014-06-12 23:19:11 -07:00
|
|
|
ok(navigator.mozAlarms instanceof AlarmsManager,
|
|
|
|
"navigator.mozAlarms should be an instance of AlarmsManager");
|
2012-06-22 00:37:49 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
SimpleTest.finish();
|
|
|
|
});
|
|
|
|
|
|
|
|
</script>
|
|
|
|
</pre>
|
|
|
|
</body>
|
|
|
|
</html>
|