dom/identity/tests/mochitest/file_fxa_rp_noOnlogout.html

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 <!--
     2   * This Source Code Form is subject to the terms of the Mozilla Public
     3   * License, v. 2.0. If a copy of the MPL was not distributed with this
     4   * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     5  -->
     6 <!DOCTYPE html>
     7 <html>
     8   <!--
     9   RPs have the correct callbacks for BrowserID or Firefox Accounts
    10   https://bugzilla.mozilla.org/show_bug.cgi?id=945363
    11   -->
    12 <head>
    13   <meta charset="utf-8">
    14   <title>Test app for bug 945363</title>
    15 </head>
    17 <body>
    18 <script type="application/javascript;version=1.7">
    20   // This is a bad Firefox Accounts RP.  It has no onlogout callback.
    21   // nsDOMIdentity will throw an exception.
    23   function postMessage(message) {
    24     SpecialPowers.wrap(window).parent
    25       .postMessage(JSON.stringify(message), "*");
    26   }
    28   let error = false;
    30   window.addEventListener('load', function onLoad(event) {
    31     window.removeEventListener('load', onLoad);
    32     try {
    33       navigator.mozId.watch({
    34         wantIssuer: "firefox-accounts",
    35         onlogin: function() {},
    36         onready: function() {},
    37       });
    38     } catch(ex) {
    39       error = true;
    40     }
    41     postMessage({error: error});
    42   }, false);
    44 </script>
    45 </body>
    46 </html>

mercurial