DXR is a code search and navigation tool aimed at making sense of large projects. It supports full-text and regex searches as well as structural queries.

Mercurial (d1ed7de67f5a)

VCS Links

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
<!DOCTYPE HTML>
<html>
<head>
  <title>Test Non-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();
if (SpecialPowers.hasPermission("alarms", document)) {
  SpecialPowers.removePermission("alarms", document);
  window.location.reload();
} else {
  SpecialPowers.pushPrefEnv({"set": [["dom.mozAlarms.enabled", true]]}, function() {
    SpecialPowers.removePermission("alarms", document);

    // mozAlarms is installed on all platforms except Android for the moment.
    if (navigator.appVersion.indexOf("Android") != -1) {
      ok(!('mozAlarms' in navigator),
         "navigator.mozAlarms should not exist without permission");
      ok(!('AlarmsManager' in window),
         "Interface AlarmsManager should not exist");
    } else {
      ok(!('mozAlarms' in navigator),
         "navigator.mozAlarms should not exist without permission");
      ok(!('AlarmsManager' in window),
         "Interface AlarmsManager should not exist without permission");
    }
    SpecialPowers.addPermission("alarms", true, document);
    SimpleTest.finish();
  });
}
</script>
</pre>
</body>
</html>