dom/identity/tests/mochitest/file_syntheticEvents.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   Certified and privileged apps can call mozId outside an event handler
    10   Certified apps:  https://bugzilla.mozilla.org/show_bug.cgi?id=971379
    11   Privileged apps: https://bugzilla.mozilla.org/show_bug.cgi?id=982460
    12   -->
    13 <head>
    14   <meta charset="utf-8">
    15   <title>Test app for bug 971379</title>
    16 </head>
    18 <body>
    19     <div id='test'>
    20 <script type="application/javascript;version=1.8">
    22   function postResults(message) {
    23     window.realParent.postMessage(JSON.stringify(message), "*");
    24   }
    26   function onready() {
    27     navigator.mozId.request();
    28   }
    30   function onlogin(backedAssertion) {
    31     postResults({success: true, backedAssertion: backedAssertion});
    32   }
    34   function onerror(error) {
    35     postResults({success: false, error: error});
    36   }
    38   onmessage = function(message) {
    39     navigator.mozId.watch({
    40       wantIssuer: message.data.wantIssuer,
    41       onready: onready,
    42       onerror: onerror,
    43       onlogin: onlogin,
    44       onlogout: function() {},
    45     });
    46   };
    48 </script>
    49 </div>
    50 </body>
    51 </html>

mercurial