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

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

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

mercurial