bug 471886 - Make places autocomplete tests even more robust against default prefs, r=Mardak
authorRobert Kaiser <kairo@kairo.at>
Sat, 10 Jan 2009 16:29:17 +0100
changeset 23522 ebc083cea40bd0a4cabe89e91775e34134ceada9
parent 23521 f7e50fb2070929f20a774d8969c0866b807b71e7
child 23523 7bf1d1b7f3b8b57bf49016347bb15414f6c24425
push id4577
push userkairo@kairo.at
push dateSat, 10 Jan 2009 15:29:37 +0000
treeherdermozilla-central@ebc083cea40b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMardak
bugs471886
milestone1.9.2a1pre
bug 471886 - Make places autocomplete tests even more robust against default prefs, r=Mardak
toolkit/components/places/tests/autocomplete/head_autocomplete.js
toolkit/components/places/tests/unit/test_000_frecency.js
toolkit/components/places/tests/unit/test_408221.js
toolkit/components/places/tests/unit/test_history_autocomplete_tags.js
--- a/toolkit/components/places/tests/autocomplete/head_autocomplete.js
+++ b/toolkit/components/places/tests/autocomplete/head_autocomplete.js
@@ -201,16 +201,17 @@ function addPageBook(aURI, aTitle, aBook
 
   print("\nAdding page/book/tag: " + out.join(", "));
 }
 
 function run_test() {
   print("\n");
   // always search in history + bookmarks, no matter what the default is
   prefs.setIntPref("browser.urlbar.search.sources", 3);
+  prefs.setIntPref("browser.urlbar.default.behavior", 0);
 
   // Search is asynchronous, so don't let the test finish immediately
   do_test_pending();
 
   // Load the test and print a description then run the test
   let [description, search, expected, func] = gTests[current_test];
   print(description);
 
--- a/toolkit/components/places/tests/unit/test_000_frecency.js
+++ b/toolkit/components/places/tests/unit/test_000_frecency.js
@@ -242,16 +242,17 @@ function run_test() {
   // Make an AutoCompleteInput that uses our searches
   // and confirms results on search complete
   var input = new AutoCompleteInput(["history"]);
 
   controller.input = input;
 
   // always search in history + bookmarks, no matter what the default is
   prefs.setIntPref("browser.urlbar.search.sources", 3);
+  prefs.setIntPref("browser.urlbar.default.behavior", 0);
 
   // Search is asynchronous, so don't let the test finish immediately
   do_test_pending();
 
   var numSearchesStarted = 0;
   input.onSearchBegin = function() {
     numSearchesStarted++;
     do_check_eq(numSearchesStarted, 1);
--- a/toolkit/components/places/tests/unit/test_408221.js
+++ b/toolkit/components/places/tests/unit/test_408221.js
@@ -162,16 +162,17 @@ var tests = [function() { ensure_tag_res
 /** 
  * Test bug #408221
  */
 function run_test() {
   // always search in history + bookmarks, no matter what the default is
   var prefs = Cc["@mozilla.org/preferences-service;1"].
               getService(Ci.nsIPrefBranch);
   prefs.setIntPref("browser.urlbar.search.sources", 3);
+  prefs.setIntPref("browser.urlbar.default.behavior", 0);
 
   tagssvc.tagURI(uri1, ["Foo"]);
   tagssvc.tagURI(uri2, ["FOO"]);
   tagssvc.tagURI(uri3, ["foO"]);
   tagssvc.tagURI(uri4, ["BAR"]);
   tagssvc.tagURI(uri4, ["MUD"]);
   tagssvc.tagURI(uri5, ["bar"]);
   tagssvc.tagURI(uri5, ["mud"]);
--- a/toolkit/components/places/tests/unit/test_history_autocomplete_tags.js
+++ b/toolkit/components/places/tests/unit/test_history_autocomplete_tags.js
@@ -185,16 +185,17 @@ var tests = [
 /** 
  * Test history autocomplete
  */
 function run_test() {
   // always search in history + bookmarks, no matter what the default is
   var prefs = Cc["@mozilla.org/preferences-service;1"].
               getService(Ci.nsIPrefBranch);
   prefs.setIntPref("browser.urlbar.search.sources", 3);
+  prefs.setIntPref("browser.urlbar.default.behavior", 0);
 
   tagssvc.tagURI(uri1, ["foo"]);
   tagssvc.tagURI(uri2, ["bar"]);
   tagssvc.tagURI(uri3, ["cheese"]);
   tagssvc.tagURI(uri4, ["foo bar"]);
   tagssvc.tagURI(uri5, ["bar cheese"]);
   tagssvc.tagURI(uri6, ["foo bar cheese"]);