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 | "use strict"; |
michael@0 | 2 | |
michael@0 | 3 | Components.utils.import("resource://gre/modules/osfile.jsm"); |
michael@0 | 4 | Components.utils.import("resource://gre/modules/Task.jsm"); |
michael@0 | 5 | |
michael@0 | 6 | function run_test() { |
michael@0 | 7 | do_test_pending(); |
michael@0 | 8 | run_next_test(); |
michael@0 | 9 | } |
michael@0 | 10 | |
michael@0 | 11 | /** |
michael@0 | 12 | * Test to ensure that |File.prototype.flush| is available in the async API. |
michael@0 | 13 | */ |
michael@0 | 14 | |
michael@0 | 15 | add_task(function test_flush() { |
michael@0 | 16 | let path = OS.Path.join(OS.Constants.Path.tmpDir, |
michael@0 | 17 | "test_osfile_async_flush.tmp"); |
michael@0 | 18 | let file = yield OS.File.open(path, {trunc: true, write: true}); |
michael@0 | 19 | try { |
michael@0 | 20 | try { |
michael@0 | 21 | yield file.flush(); |
michael@0 | 22 | } finally { |
michael@0 | 23 | yield file.close(); |
michael@0 | 24 | } |
michael@0 | 25 | } finally { |
michael@0 | 26 | yield OS.File.remove(path); |
michael@0 | 27 | } |
michael@0 | 28 | }); |
michael@0 | 29 | |
michael@0 | 30 | add_task(do_test_finished); |