Bug 1097106 - Disable Search Provider Top Suggestion feature. r=paolo
authorBlair McBride <bmcbride@mozilla.com>
Mon, 24 Nov 2014 11:57:03 +1300
changeset 217102 c294ed0b5502b2a904e8b2f985aaa85172b42870
parent 217101 fc4f585ae3a16fe1babf7d6ba59ba0f5274cf15d
child 217103 2acc754928c80d372ca1f70f5e1f2694fc2639b3
push id52224
push usercbook@mozilla.com
push dateMon, 24 Nov 2014 13:16:24 +0000
treeherdermozilla-inbound@bf9071999612 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspaolo
bugs1097106
milestone36.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1097106 - Disable Search Provider Top Suggestion feature. r=paolo
toolkit/components/places/UnifiedComplete.js
toolkit/components/places/tests/unifiedcomplete/test_avoid_middle_complete.js
toolkit/components/places/tests/unifiedcomplete/test_searchEngine_host.js
--- a/toolkit/components/places/UnifiedComplete.js
+++ b/toolkit/components/places/UnifiedComplete.js
@@ -12,17 +12,17 @@
 const { classes: Cc, interfaces: Ci, results: Cr, utils: Cu } = Components;
 
 const PREF_BRANCH = "browser.urlbar.";
 
 // Prefs are defined as [pref name, default value].
 const PREF_ENABLED =                [ "autocomplete.enabled",   true ];
 const PREF_AUTOFILL =               [ "autoFill",               true ];
 const PREF_AUTOFILL_TYPED =         [ "autoFill.typed",         true ];
-const PREF_AUTOFILL_SEARCHENGINES = [ "autoFill.searchEngines", true ];
+const PREF_AUTOFILL_SEARCHENGINES = [ "autoFill.searchEngines", false ];
 const PREF_RESTYLESEARCHES        = [ "restyleSearches",        false ];
 const PREF_DELAY =                  [ "delay",                  50 ];
 const PREF_BEHAVIOR =               [ "matchBehavior", MATCH_BOUNDARY_ANYWHERE ];
 const PREF_FILTER_JS =              [ "filter.javascript",      true ];
 const PREF_MAXRESULTS =             [ "maxRichResults",         25 ];
 const PREF_RESTRICT_HISTORY =       [ "restrict.history",       "^" ];
 const PREF_RESTRICT_BOOKMARKS =     [ "restrict.bookmark",      "*" ];
 const PREF_RESTRICT_TYPED =         [ "restrict.typed",         "~" ];
--- a/toolkit/components/places/tests/unifiedcomplete/test_avoid_middle_complete.js
+++ b/toolkit/components/places/tests/unifiedcomplete/test_avoid_middle_complete.js
@@ -26,16 +26,17 @@ add_task(function* test_trailing_space_n
     autofilled: "mo ",
     completed: "mo "
   });
 
   yield cleanup();
 });
 
 add_task(function* test_searchEngine_autofill() {
+  Services.prefs.setBoolPref("browser.urlbar.autoFill.searchEngines", true);
   Services.search.addEngineWithDetails("CakeSearch", "", "", "",
                                        "GET", "http://cake.search/");
   let engine = Services.search.getEngineByName("CakeSearch");
   engine.addParam("q", "{searchTerms}", null);
   do_register_cleanup(() => Services.search.removeEngine(engine));
 
   do_log_info("Should autoFill search engine if search string does not contains a space");
   yield check_autocomplete({
@@ -43,16 +44,17 @@ add_task(function* test_searchEngine_aut
     autofilled: "cake.search",
     completed: "http://cake.search"
   });
 
   yield cleanup();
 });
 
 add_task(function* test_searchEngine_prefix_space_noautofill() {
+  Services.prefs.setBoolPref("browser.urlbar.autoFill.searchEngines", true);
   Services.search.addEngineWithDetails("CupcakeSearch", "", "", "",
                                        "GET", "http://cupcake.search/");
   let engine = Services.search.getEngineByName("CupcakeSearch");
   engine.addParam("q", "{searchTerms}", null);
   do_register_cleanup(() => Services.search.removeEngine(engine));
 
   do_log_info("Should not try to autoFill search engine if search string contains a space");
   yield check_autocomplete({
@@ -60,16 +62,17 @@ add_task(function* test_searchEngine_pre
     autofilled: " cu",
     completed: " cu"
   });
 
   yield cleanup();
 });
 
 add_task(function* test_searchEngine_trailing_space_noautofill() {
+  Services.prefs.setBoolPref("browser.urlbar.autoFill.searchEngines", true);
   Services.search.addEngineWithDetails("BaconSearch", "", "", "",
                                        "GET", "http://bacon.search/");
   let engine = Services.search.getEngineByName("BaconSearch");
   engine.addParam("q", "{searchTerms}", null);
   do_register_cleanup(() => Services.search.removeEngine(engine));
 
   do_log_info("Should not try to autoFill search engine if search string contains a space");
   yield check_autocomplete({
@@ -77,16 +80,17 @@ add_task(function* test_searchEngine_tra
     autofilled: "ba ",
     completed: "ba "
   });
 
   yield cleanup();
 });
 
 add_task(function* test_searchEngine_www_noautofill() {
+  Services.prefs.setBoolPref("browser.urlbar.autoFill.searchEngines", true);
   Services.search.addEngineWithDetails("HamSearch", "", "", "",
                                        "GET", "http://ham.search/");
   let engine = Services.search.getEngineByName("HamSearch");
   engine.addParam("q", "{searchTerms}", null);
   do_register_cleanup(() => Services.search.removeEngine(engine));
 
   do_log_info("Should not autoFill search engine if search string contains www. but engine doesn't");
   yield check_autocomplete({
@@ -94,16 +98,17 @@ add_task(function* test_searchEngine_www
     autofilled: "www.ham",
     completed: "www.ham"
   });
 
   yield cleanup();
 });
 
 add_task(function* test_searchEngine_different_scheme_noautofill() {
+  Services.prefs.setBoolPref("browser.urlbar.autoFill.searchEngines", true);
   Services.search.addEngineWithDetails("PieSearch", "", "", "",
                                        "GET", "https://pie.search/");
   let engine = Services.search.getEngineByName("PieSearch");
   engine.addParam("q", "{searchTerms}", null);
   do_register_cleanup(() => Services.search.removeEngine(engine));
 
   do_log_info("Should not autoFill search engine if search string has a different scheme.");
   yield check_autocomplete({
@@ -111,16 +116,17 @@ add_task(function* test_searchEngine_dif
     autofilled: "http://pie",
     completed: "http://pie"
   });
 
   yield cleanup();
 });
 
 add_task(function* test_searchEngine_matching_prefix_autofill() {
+  Services.prefs.setBoolPref("browser.urlbar.autoFill.searchEngines", true);
   Services.search.addEngineWithDetails("BeanSearch", "", "", "",
                                        "GET", "http://www.bean.search/");
   let engine = Services.search.getEngineByName("BeanSearch");
   engine.addParam("q", "{searchTerms}", null);
   do_register_cleanup(() => Services.search.removeEngine(engine));
 
 
   do_log_info("Should autoFill search engine if search string has matching prefix.");
--- a/toolkit/components/places/tests/unifiedcomplete/test_searchEngine_host.js
+++ b/toolkit/components/places/tests/unifiedcomplete/test_searchEngine_host.js
@@ -33,16 +33,17 @@ function* addTestEngines(items) {
     });
   }
 
   return engines;
 }
 
 
 add_task(function* test_searchEngine_autoFill() {
+  Services.prefs.setBoolPref("browser.urlbar.autoFill.searchEngines", true);
   Services.search.addEngineWithDetails("MySearchEngine", "", "", "",
                                        "GET", "http://my.search.com/");
   let engine = Services.search.getEngineByName("MySearchEngine");
   do_register_cleanup(() => Services.search.removeEngine(engine));
 
   // Add an uri that matches the search string with high frecency.
   let uri = NetUtil.newURI("http://www.example.com/my/");
   let visits = [];