Sat, 03 Jan 2015 20:18:00 +0100
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 | /* -*- Mode: javascript; js-indent-level: 2; -*- */ |
michael@0 | 2 | /* Any copyright is dedicated to the Public Domain. |
michael@0 | 3 | http://creativecommons.org/publicdomain/zero/1.0/ */ |
michael@0 | 4 | |
michael@0 | 5 | // Test that we can detect nested event loops in tabs with the same URL. |
michael@0 | 6 | |
michael@0 | 7 | var gClient1, gClient2, gThreadClient1, gThreadClient2; |
michael@0 | 8 | |
michael@0 | 9 | function run_test() { |
michael@0 | 10 | initTestDebuggerServer(); |
michael@0 | 11 | addTestGlobal("test-nesting1"); |
michael@0 | 12 | addTestGlobal("test-nesting1"); |
michael@0 | 13 | // Conect the first client to the first debuggee. |
michael@0 | 14 | gClient1 = new DebuggerClient(DebuggerServer.connectPipe()); |
michael@0 | 15 | gClient1.connect(function () { |
michael@0 | 16 | attachTestThread(gClient1, "test-nesting1", function (aResponse, aTabClient, aThreadClient) { |
michael@0 | 17 | gThreadClient1 = aThreadClient; |
michael@0 | 18 | start_second_connection(); |
michael@0 | 19 | }); |
michael@0 | 20 | }); |
michael@0 | 21 | do_test_pending(); |
michael@0 | 22 | } |
michael@0 | 23 | |
michael@0 | 24 | function start_second_connection() { |
michael@0 | 25 | gClient2 = new DebuggerClient(DebuggerServer.connectPipe()); |
michael@0 | 26 | gClient2.connect(function () { |
michael@0 | 27 | attachTestThread(gClient2, "test-nesting1", function (aResponse, aTabClient, aThreadClient) { |
michael@0 | 28 | gThreadClient2 = aThreadClient; |
michael@0 | 29 | test_nesting(); |
michael@0 | 30 | }); |
michael@0 | 31 | }); |
michael@0 | 32 | } |
michael@0 | 33 | |
michael@0 | 34 | function test_nesting() { |
michael@0 | 35 | const { resolve, reject, promise: p } = promise.defer(); |
michael@0 | 36 | |
michael@0 | 37 | gThreadClient1.resume(aResponse => { |
michael@0 | 38 | do_check_eq(aResponse.error, "wrongOrder"); |
michael@0 | 39 | gThreadClient2.resume(aResponse => { |
michael@0 | 40 | do_check_true(!aResponse.error); |
michael@0 | 41 | do_check_eq(aResponse.from, gThreadClient2.actor); |
michael@0 | 42 | |
michael@0 | 43 | gThreadClient1.resume(aResponse => { |
michael@0 | 44 | do_check_true(!aResponse.error); |
michael@0 | 45 | do_check_eq(aResponse.from, gThreadClient1.actor); |
michael@0 | 46 | |
michael@0 | 47 | gClient1.close(() => finishClient(gClient2)); |
michael@0 | 48 | }); |
michael@0 | 49 | }); |
michael@0 | 50 | }); |
michael@0 | 51 | } |