dom/identity/tests/mochitest/file_fxa_rp_noOnlogout.html

branch
TOR_BUG_3246
changeset 7
129ffea94266
equal deleted inserted replaced
-1:000000000000 0:706e48ca8c30
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>
16
17 <body>
18 <script type="application/javascript;version=1.7">
19
20 // This is a bad Firefox Accounts RP. It has no onlogout callback.
21 // nsDOMIdentity will throw an exception.
22
23 function postMessage(message) {
24 SpecialPowers.wrap(window).parent
25 .postMessage(JSON.stringify(message), "*");
26 }
27
28 let error = false;
29
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);
43
44 </script>
45 </body>
46 </html>

mercurial