Bug 1466548 - Fix test_adaptive_limited.js when maxRichResults is not set. r=adw
authorMarco Bonardo <mbonardo@mozilla.com>
Mon, 04 Jun 2018 18:04:22 +0200
changeset 804153 b523c89c3497596fab20cda825115daa5b0b7ac4
parent 804152 988847e0ed2ec4f3c87fa3cf92c08eb2a1acd18c
child 804154 1c7d89955364c87b891157ffdde74be8c3ea74cc
push id112312
push userbmo:standard8@mozilla.com
push dateTue, 05 Jun 2018 16:07:56 +0000
reviewersadw
bugs1466548
milestone62.0a1
Bug 1466548 - Fix test_adaptive_limited.js when maxRichResults is not set. r=adw MozReview-Commit-ID: 7F0Arzt0vhU
toolkit/components/places/tests/unifiedcomplete/test_adaptive_limited.js
--- a/toolkit/components/places/tests/unifiedcomplete/test_adaptive_limited.js
+++ b/toolkit/components/places/tests/unifiedcomplete/test_adaptive_limited.js
@@ -24,17 +24,17 @@ add_task(async function() {
 
   registerCleanupFunction(async function() {
     await PlacesUtils.bookmarks.eraseEverything();
     await PlacesUtils.history.clear();
   });
 
   let matches = uris.map(uri => ({ uri: Services.io.newURI(uri),
                                    title: "test visit for " + uri }));
-  let book_index = Math.ceil(Services.prefs.getIntPref("browser.urlbar.maxRichResults") / 4);
+  let book_index = Math.ceil(Services.prefs.getIntPref("browser.urlbar.maxRichResults", 10) / 4);
   matches.splice(book_index, 0, { uri: Services.io.newURI(bm.url.href),
                                   title: "test_book", "style": ["bookmark"] });
 
   await check_autocomplete({
     search: "book",
     matches,
     checkSorting: true,
   });