dom/alarm/test/test_alarm_permitted_app.html
author David Anderson <danderson@mozilla.com>
Thu, 09 Aug 2012 13:41:13 -0700
changeset 106654 52fdeb6d8d6dc6947dc4712f0781fd17beba65d1
parent 98520 b3d4127dd8cefb1405cbc295aebda05c343ac850
child 107908 1f7c4fae49c0d80075e7b0380c4b841a5ed30ab0
permissions -rw-r--r--
Merge from mozilla-central.

<!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);

  // 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");
    ok(navigator.mozAlarms, "navigator.mozAlarms should return an object");
    ok(navigator.mozAlarms instanceof Components.interfaces.nsIDOMMozAlarmsManager,
      "navigator.mozAlarms should be an nsIDOMMozAlarmsManager object");
  }

  SpecialPowers.removePermission("alarms", document);
  SimpleTest.finish();
});

</script>
</pre>
</body>
</html>