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 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 3 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 4 | |
michael@0 | 5 | // This file tests migration from v5 to v6 |
michael@0 | 6 | |
michael@0 | 7 | function run_test() |
michael@0 | 8 | { |
michael@0 | 9 | // First import the downloads.sqlite file |
michael@0 | 10 | importDatabaseFile("v5.sqlite"); |
michael@0 | 11 | |
michael@0 | 12 | // ok, now it is OK to init the download manager - this will perform the |
michael@0 | 13 | // migration! |
michael@0 | 14 | var dm = Cc["@mozilla.org/download-manager;1"]. |
michael@0 | 15 | getService(Ci.nsIDownloadManager); |
michael@0 | 16 | var dbConn = dm.DBConnection; |
michael@0 | 17 | |
michael@0 | 18 | // check schema version |
michael@0 | 19 | do_check_true(dbConn.schemaVersion >= 6); |
michael@0 | 20 | |
michael@0 | 21 | // Check that the columns exist (no throw) and entries are correct |
michael@0 | 22 | var stmt = dbConn.createStatement( |
michael@0 | 23 | "SELECT name, source, target, startTime, endTime, state, referrer, " + |
michael@0 | 24 | "entityID, tempPath, currBytes, maxBytes " + |
michael@0 | 25 | "FROM moz_downloads " + |
michael@0 | 26 | "WHERE id = 27"); |
michael@0 | 27 | stmt.executeStep(); |
michael@0 | 28 | do_check_eq("Firefox 2.0.0.6.dmg", stmt.getString(0)); |
michael@0 | 29 | do_check_eq("http://ftp-mozilla.netscape.com/pub/mozilla.org/firefox/releases/2.0.0.6/mac/en-US/Firefox%202.0.0.6.dmg", |
michael@0 | 30 | stmt.getUTF8String(1)); |
michael@0 | 31 | do_check_eq("file:///Users/sdwilsh/Desktop/Firefox%202.0.0.6.dmg", |
michael@0 | 32 | stmt.getUTF8String(2)); |
michael@0 | 33 | do_check_eq(1187390974170783, stmt.getInt64(3)); |
michael@0 | 34 | do_check_eq(1187391001257446, stmt.getInt64(4)); |
michael@0 | 35 | do_check_eq(1, stmt.getInt32(5)); |
michael@0 | 36 | do_check_eq("http://www.mozilla.com/en-US/products/download.html?product=firefox-2.0.0.6&os=osx&lang=en-US",stmt.getUTF8String(6)); |
michael@0 | 37 | do_check_true(stmt.getIsNull(7)); |
michael@0 | 38 | do_check_true(stmt.getIsNull(8)); |
michael@0 | 39 | do_check_eq(0, stmt.getInt64(9)); |
michael@0 | 40 | do_check_eq(-1, stmt.getInt64(10)); |
michael@0 | 41 | stmt.finalize(); |
michael@0 | 42 | |
michael@0 | 43 | cleanup(); |
michael@0 | 44 | } |