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.
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
3 * You can obtain one at http://mozilla.org/MPL/2.0/. */
5 /**
6 * Checks that we don't encodeURI twice when creating bookmarks.html.
7 */
9 function run_test() {
10 run_next_test();
11 }
13 add_task(function() {
14 let uri = NetUtil.newURI("http://bt.ktxp.com/search.php?keyword=%E5%A6%84%E6%83%B3%E5%AD%A6%E7%94%9F%E4%BC%9A");
15 let bm = PlacesUtils.bookmarks.insertBookmark(PlacesUtils.unfiledBookmarksFolderId,
16 uri,
17 PlacesUtils.bookmarks.DEFAULT_INDEX,
18 "bookmark");
20 let file = OS.Path.join(OS.Constants.Path.profileDir, "bookmarks.exported.997030.html");
21 if ((yield OS.File.exists(file))) {
22 yield OS.File.remove(file);
23 }
24 yield BookmarkHTMLUtils.exportToFile(file);
26 // Remove the bookmarks, then restore the backup.
27 PlacesUtils.bookmarks.removeItem(bm);
28 yield BookmarkHTMLUtils.importFromFile(file, true);
30 do_log_info("Checking first level");
31 let root = PlacesUtils.getFolderContents(PlacesUtils.unfiledBookmarksFolderId).root;
32 let node = root.getChild(0);
33 do_check_eq(node.uri, uri.spec);
35 root.containerOpen = false;
36 PlacesUtils.bookmarks.removeFolderChildren(PlacesUtils.unfiledBookmarksFolderId);
37 });