dom/identity/tests/mochitest/file_declareAudience.html

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

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 packaged apps should be able to declare assertion audience.
michael@0 10 https://bugzilla.mozilla.org/show_bug.cgi?id=947374
michael@0 11 -->
michael@0 12 <head>
michael@0 13 <meta charset="utf-8">
michael@0 14 <title>Test app for bug 947374</title>
michael@0 15 </head>
michael@0 16
michael@0 17 <body>
michael@0 18 <div id='test'>
michael@0 19 <script type="application/javascript;version=1.8">
michael@0 20
michael@0 21 function postResults(message) {
michael@0 22 window.realParent.postMessage(JSON.stringify(message), "*");
michael@0 23 }
michael@0 24
michael@0 25 function onready() {
michael@0 26 navigator.mozId.request();
michael@0 27 }
michael@0 28
michael@0 29 function onlogin(backedAssertion) {
michael@0 30 postResults({success: true, backedAssertion: backedAssertion});
michael@0 31 }
michael@0 32
michael@0 33 function onerror(error) {
michael@0 34 postResults({success: false, error: error});
michael@0 35 }
michael@0 36
michael@0 37 onmessage = function(event) {
michael@0 38 navigator.mozId.watch({
michael@0 39 wantIssuer: "firefox-accounts",
michael@0 40 audience: event.data.audience,
michael@0 41 onready: onready,
michael@0 42 onlogin: onlogin,
michael@0 43 onerror: onerror,
michael@0 44
michael@0 45 // onlogout will actually be called every time watch() is invoked,
michael@0 46 // because fxa will find no signed-in user and so trigger logout.
michael@0 47 // For this test, though, we don't care and just ignore logout.
michael@0 48 onlogout: function () {},
michael@0 49 });
michael@0 50 };
michael@0 51
michael@0 52 </script>
michael@0 53 </div>
michael@0 54 </body>
michael@0 55 </html>

mercurial