toolkit/components/places/tests/inline/test_do_not_trim.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/toolkit/components/places/tests/inline/test_do_not_trim.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,67 @@
     1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this file,
     1.6 + * You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.7 +
     1.8 +// Inline should never return matches shorter than the search string, since
     1.9 +// that largely confuses completeDefaultIndex
    1.10 +
    1.11 +add_autocomplete_test([
    1.12 +  "Do not autofill whitespaced entry 1",
    1.13 +  "mozilla.org ",
    1.14 +  "mozilla.org ",
    1.15 +  function () {
    1.16 +    promiseAddVisits({ uri: NetUtil.newURI("http://mozilla.org/link/"),
    1.17 +                       transition: TRANSITION_TYPED });
    1.18 +  }
    1.19 +]);
    1.20 +
    1.21 +add_autocomplete_test([
    1.22 +  "Do not autofill whitespaced entry 2",
    1.23 +  "mozilla.org/ ",
    1.24 +  "mozilla.org/ ",
    1.25 +  function () {
    1.26 +    promiseAddVisits({ uri: NetUtil.newURI("http://mozilla.org/link/"),
    1.27 +                       transition: TRANSITION_TYPED });
    1.28 +  }
    1.29 +]);
    1.30 +
    1.31 +add_autocomplete_test([
    1.32 +  "Do not autofill whitespaced entry 3",
    1.33 +  "mozilla.org/link ",
    1.34 +  "mozilla.org/link ",
    1.35 +  function () {
    1.36 +    promiseAddVisits({ uri: NetUtil.newURI("http://mozilla.org/link/"),
    1.37 +                       transition: TRANSITION_TYPED });
    1.38 +  }
    1.39 +]);
    1.40 +
    1.41 +add_autocomplete_test([
    1.42 +  "Do not autofill whitespaced entry 4",
    1.43 +  "mozilla.org/link/ ",
    1.44 +  "mozilla.org/link/ ",
    1.45 +  function () {
    1.46 +    promiseAddVisits({ uri: NetUtil.newURI("http://mozilla.org/link/"),
    1.47 +                       transition: TRANSITION_TYPED });
    1.48 +  }
    1.49 +]);
    1.50 +
    1.51 +
    1.52 +add_autocomplete_test([
    1.53 +  "Do not autofill whitespaced entry 5",
    1.54 +  "moz illa ",
    1.55 +  "moz illa ",
    1.56 +  function () {
    1.57 +    promiseAddVisits({ uri: NetUtil.newURI("http://mozilla.org/link/"),
    1.58 +                       transition: TRANSITION_TYPED });
    1.59 +  }
    1.60 +]);
    1.61 +
    1.62 +add_autocomplete_test([
    1.63 +  "Do not autofill whitespaced entry 6",
    1.64 +  " mozilla",
    1.65 +  " mozilla",
    1.66 +  function () {
    1.67 +    promiseAddVisits({ uri: NetUtil.newURI("http://mozilla.org/link/"),
    1.68 +                       transition: TRANSITION_TYPED });
    1.69 +  }
    1.70 +]);

mercurial