|
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/. */ |
|
4 |
|
5 // Inline should never return matches shorter than the search string, since |
|
6 // that largely confuses completeDefaultIndex |
|
7 |
|
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 ]); |
|
17 |
|
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 ]); |
|
27 |
|
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 ]); |
|
37 |
|
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 ]); |
|
47 |
|
48 |
|
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 ]); |
|
58 |
|
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 ]); |