dom/identity/tests/mochitest/file_browserid_rp_ok.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/identity/tests/mochitest/file_browserid_rp_ok.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,43 @@
     1.4 +<!--
     1.5 +  * This Source Code Form is subject to the terms of the Mozilla Public
     1.6 +  * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 +  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 + -->
     1.9 +<!DOCTYPE html>
    1.10 +<html>
    1.11 +  <!--
    1.12 +  RPs have the correct callbacks for BrowserID or Firefox Accounts
    1.13 +  https://bugzilla.mozilla.org/show_bug.cgi?id=945363
    1.14 +  -->
    1.15 +<head>
    1.16 +  <meta charset="utf-8">
    1.17 +  <title>Test app for bug 945363</title>
    1.18 +</head>
    1.19 +
    1.20 +<body>
    1.21 +<script type="application/javascript;version=1.7">
    1.22 +
    1.23 +  // This is a happy RP.  It has the expected callbacks for BrowserID.
    1.24 +
    1.25 +  function postMessage(message) {
    1.26 +    SpecialPowers.wrap(window).parent
    1.27 +      .postMessage(JSON.stringify(message), "*");
    1.28 +  }
    1.29 +
    1.30 +  let error = false;
    1.31 +
    1.32 +  window.addEventListener('load', function onLoad(event) {
    1.33 +    window.removeEventListener('load', onLoad);
    1.34 +    try {
    1.35 +      navigator.mozId.watch({
    1.36 +        onlogin: function() {},
    1.37 +      });
    1.38 +    } catch(ex) {
    1.39 +      error = true;
    1.40 +    }
    1.41 +    postMessage({error: error});
    1.42 +  }, false);
    1.43 +
    1.44 +</script>
    1.45 +</body>
    1.46 +</html>

mercurial