summaryrefslogtreecommitdiffstats
path: root/toolkit/components/places/tests/unifiedcomplete/test_zero_frecency.js
blob: adf6388869f08d9307e7edb125e6c369777eeaf1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */

// Ensure inline autocomplete doesn't return zero frecency pages.

add_task(function* test_zzero_frec_domain() {
  do_print("Searching for zero frecency domain should not autoFill it");
  Services.prefs.setBoolPref("browser.urlbar.autoFill.typed", false);
  yield PlacesTestUtils.addVisits({
    uri: NetUtil.newURI("http://mozilla.org/framed_link/"),
    transition: TRANSITION_FRAMED_LINK
  });
  yield check_autocomplete({
    search: "moz",
    autofilled: "moz",
    completed:  "moz"
  });
  yield cleanup();
});

add_task(function* test_zzero_frec_url() {
  do_print("Searching for zero frecency url should not autoFill it");
  Services.prefs.setBoolPref("browser.urlbar.autoFill.typed", false);
  yield PlacesTestUtils.addVisits({
    uri: NetUtil.newURI("http://mozilla.org/framed_link/"),
    transition: TRANSITION_FRAMED_LINK
  });
  yield check_autocomplete({
    search: "mozilla.org/f",
    autofilled: "mozilla.org/f",
    completed:  "mozilla.org/f"
  });
  yield cleanup();
});