toolkit/components/places/tests/autocomplete/test_download_embed_bookmarks.js

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 /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
michael@0 2 * vim:set ts=2 sw=2 sts=2 et:
michael@0 3 * This Source Code Form is subject to the terms of the Mozilla Public
michael@0 4 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 6
michael@0 7 /**
michael@0 8 * Tests bug 449406 to ensure that TRANSITION_DOWNLOAD, TRANSITION_EMBED and
michael@0 9 * TRANSITION_FRAMED_LINK bookmarked uri's show up in the location bar.
michael@0 10 */
michael@0 11
michael@0 12 // Define some shared uris and titles (each page needs its own uri)
michael@0 13 let kURIs = [
michael@0 14 "http://download/bookmarked",
michael@0 15 "http://embed/bookmarked",
michael@0 16 "http://framed/bookmarked",
michael@0 17 "http://download",
michael@0 18 "http://embed",
michael@0 19 "http://framed",
michael@0 20 ];
michael@0 21 let kTitles = [
michael@0 22 "download-bookmark",
michael@0 23 "embed-bookmark",
michael@0 24 "framed-bookmark",
michael@0 25 "download2",
michael@0 26 "embed2",
michael@0 27 "framed2",
michael@0 28 ];
michael@0 29
michael@0 30 // Add download and embed uris
michael@0 31 addPageBook(0, 0, 0, undefined, undefined, TRANSITION_DOWNLOAD);
michael@0 32 addPageBook(1, 1, 1, undefined, undefined, TRANSITION_EMBED);
michael@0 33 addPageBook(2, 2, 2, undefined, undefined, TRANSITION_FRAMED_LINK);
michael@0 34 addPageBook(3, 3, undefined, undefined, undefined, TRANSITION_DOWNLOAD);
michael@0 35 addPageBook(4, 4, undefined, undefined, undefined, TRANSITION_EMBED);
michael@0 36 addPageBook(5, 5, undefined, undefined, undefined, TRANSITION_FRAMED_LINK);
michael@0 37
michael@0 38 // Provide for each test: description; search terms; array of gPages indices of
michael@0 39 // pages that should match; optional function to be run before the test
michael@0 40 let gTests = [
michael@0 41 ["0: Searching for bookmarked download uri matches",
michael@0 42 kTitles[0], [0]],
michael@0 43 ["1: Searching for bookmarked embed uri matches",
michael@0 44 kTitles[1], [1]],
michael@0 45 ["2: Searching for bookmarked framed uri matches",
michael@0 46 kTitles[2], [2]],
michael@0 47 ["3: Searching for download uri does not match",
michael@0 48 kTitles[3], []],
michael@0 49 ["4: Searching for embed uri does not match",
michael@0 50 kTitles[4], []],
michael@0 51 ["5: Searching for framed uri does not match",
michael@0 52 kTitles[5], []],
michael@0 53 ];

mercurial