2012-06-22 00:37:49 -07:00
|
|
|
<!DOCTYPE HTML>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<title>Test Non-Permitted Application for Alarm API</title>
|
|
|
|
<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";
|
|
|
|
|
2013-03-07 12:48:34 -08:00
|
|
|
function alarmtests() {
|
|
|
|
SimpleTest.waitForExplicitFinish();
|
2012-06-22 00:37:49 -07:00
|
|
|
|
2013-03-07 12:48:34 -08:00
|
|
|
SpecialPowers.pushPrefEnv({"set": [["dom.mozAlarms.enabled", true]]}, function() {
|
|
|
|
|
|
|
|
// mozAlarms is intalled on all platforms except Android for the moment.
|
|
|
|
if (navigator.appVersion.indexOf("Android") != -1) {
|
|
|
|
ok(!('mozAlarms' in navigator), "navigator.mozAlarms should not exist");
|
|
|
|
} else {
|
|
|
|
ok('mozAlarms' in navigator, "navigator.mozAlarms should exist");
|
|
|
|
is(navigator.mozAlarms, null, "navigator.mozAlarms should return null");
|
|
|
|
}
|
|
|
|
SpecialPowers.addPermission("alarms", true, document);
|
|
|
|
SimpleTest.finish();
|
|
|
|
});
|
2012-06-22 00:37:49 -07:00
|
|
|
|
2013-03-07 12:48:34 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
if(!SpecialPowers.hasPermission("alarms", document)) {
|
|
|
|
var head = document.getElementsByTagName('head')[0];
|
|
|
|
var js = document.createElement("script");
|
|
|
|
js.type = "application/javascript";
|
|
|
|
js.src = "/tests/SimpleTest/SimpleTest.js";
|
|
|
|
js.onload = alarmtests;
|
|
|
|
head.appendChild(js);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
SpecialPowers.removePermission("alarms", document);
|
|
|
|
window.location = window.location;
|
|
|
|
}
|
2012-06-22 00:37:49 -07:00
|
|
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
</pre>
|
|
|
|
</body>
|
|
|
|
</html>
|