Bug 1466548 - Fix test_adaptive_limited.js when maxRichResults is not set. r=adw draft
authorMarco Bonardo <mbonardo@mozilla.com>
Mon, 04 Jun 2018 18:04:22 +0200
changeset 803578 f4f60b208421911d08743d08ba7b45e2e61f681e
parent 803479 fa5724780fe76d6ccbbd08d978342a1db6a43d49
child 804516 2ff4cde2f92e057443e8c8252f1ffda0189c847c
push id112153
push usermak77@bonardo.net
push dateMon, 04 Jun 2018 16:08:44 +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,
   });