toolkit/components/places/tests/inline/test_do_not_trim.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.

     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 // Inline should never return matches shorter than the search string, since
     6 // that largely confuses completeDefaultIndex
     8 add_autocomplete_test([
     9   "Do not autofill whitespaced entry 1",
    10   "mozilla.org ",
    11   "mozilla.org ",
    12   function () {
    13     promiseAddVisits({ uri: NetUtil.newURI("http://mozilla.org/link/"),
    14                        transition: TRANSITION_TYPED });
    15   }
    16 ]);
    18 add_autocomplete_test([
    19   "Do not autofill whitespaced entry 2",
    20   "mozilla.org/ ",
    21   "mozilla.org/ ",
    22   function () {
    23     promiseAddVisits({ uri: NetUtil.newURI("http://mozilla.org/link/"),
    24                        transition: TRANSITION_TYPED });
    25   }
    26 ]);
    28 add_autocomplete_test([
    29   "Do not autofill whitespaced entry 3",
    30   "mozilla.org/link ",
    31   "mozilla.org/link ",
    32   function () {
    33     promiseAddVisits({ uri: NetUtil.newURI("http://mozilla.org/link/"),
    34                        transition: TRANSITION_TYPED });
    35   }
    36 ]);
    38 add_autocomplete_test([
    39   "Do not autofill whitespaced entry 4",
    40   "mozilla.org/link/ ",
    41   "mozilla.org/link/ ",
    42   function () {
    43     promiseAddVisits({ uri: NetUtil.newURI("http://mozilla.org/link/"),
    44                        transition: TRANSITION_TYPED });
    45   }
    46 ]);
    49 add_autocomplete_test([
    50   "Do not autofill whitespaced entry 5",
    51   "moz illa ",
    52   "moz illa ",
    53   function () {
    54     promiseAddVisits({ uri: NetUtil.newURI("http://mozilla.org/link/"),
    55                        transition: TRANSITION_TYPED });
    56   }
    57 ]);
    59 add_autocomplete_test([
    60   "Do not autofill whitespaced entry 6",
    61   " mozilla",
    62   " mozilla",
    63   function () {
    64     promiseAddVisits({ uri: NetUtil.newURI("http://mozilla.org/link/"),
    65                        transition: TRANSITION_TYPED });
    66   }
    67 ]);

mercurial