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

michael@0 1 <!--
michael@0 2 * This Source Code Form is subject to the terms of the Mozilla Public
michael@0 3 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 5 -->
michael@0 6 <!DOCTYPE html>
michael@0 7 <html>
michael@0 8 <!--
michael@0 9 Certified and privileged apps can call mozId outside an event handler
michael@0 10 Certified apps: https://bugzilla.mozilla.org/show_bug.cgi?id=971379
michael@0 11 Privileged apps: https://bugzilla.mozilla.org/show_bug.cgi?id=982460
michael@0 12 -->
michael@0 13 <head>
michael@0 14 <meta charset="utf-8">
michael@0 15 <title>Test app for bug 971379</title>
michael@0 16 </head>
michael@0 17
michael@0 18 <body>
michael@0 19 <div id='test'>
michael@0 20 <script type="application/javascript;version=1.8">
michael@0 21
michael@0 22 function postResults(message) {
michael@0 23 window.realParent.postMessage(JSON.stringify(message), "*");
michael@0 24 }
michael@0 25
michael@0 26 function onready() {
michael@0 27 navigator.mozId.request();
michael@0 28 }
michael@0 29
michael@0 30 function onlogin(backedAssertion) {
michael@0 31 postResults({success: true, backedAssertion: backedAssertion});
michael@0 32 }
michael@0 33
michael@0 34 function onerror(error) {
michael@0 35 postResults({success: false, error: error});
michael@0 36 }
michael@0 37
michael@0 38 onmessage = function(message) {
michael@0 39 navigator.mozId.watch({
michael@0 40 wantIssuer: message.data.wantIssuer,
michael@0 41 onready: onready,
michael@0 42 onerror: onerror,
michael@0 43 onlogin: onlogin,
michael@0 44 onlogout: function() {},
michael@0 45 });
michael@0 46 };
michael@0 47
michael@0 48 </script>
michael@0 49 </div>
michael@0 50 </body>
michael@0 51 </html>

mercurial