Bug 1365139 - Reduce the amount of iterations for test_removeMany.js so that it takes less time overall to avoid timeouts. r?mak draft
authorMark Banner <standard8@mozilla.com>
Fri, 19 May 2017 14:50:31 +0100
changeset 582367 4b5d9dcd5836a49ae3f384100a6315eb18bfd11f
parent 582257 9851fcb0bf4d855c36729d7de19f0fa5c9f69776
child 629746 bb1106d6c4fcb63b65072c020f451300fe7387ea
push id60056
push userbmo:standard8@mozilla.com
push dateMon, 22 May 2017 10:32:16 +0000
reviewersmak
bugs1365139
milestone55.0a1
Bug 1365139 - Reduce the amount of iterations for test_removeMany.js so that it takes less time overall to avoid timeouts. r?mak MozReview-Commit-ID: DSjPWtjicCQ
toolkit/components/places/tests/history/test_removeMany.js
--- a/toolkit/components/places/tests/history/test_removeMany.js
+++ b/toolkit/components/places/tests/history/test_removeMany.js
@@ -3,18 +3,18 @@
 
 // Tests for `History.remove` with removing many urls, as implemented in
 // History.jsm.
 
 "use strict";
 
 // Test removing a list of pages
 add_task(async function test_remove_many() {
-  // This is set so that we are guarenteed to trigger REMOVE_PAGES_CHUNKLEN.
-  const SIZE = 1000;
+  // This is set so that we are guaranteed to trigger REMOVE_PAGES_CHUNKLEN.
+  const SIZE = 310;
 
   await PlacesTestUtils.clearHistory();
   await PlacesUtils.bookmarks.eraseEverything();
 
   do_print("Adding a witness page");
   let WITNESS_URI = NetUtil.newURI("http://mozilla.com/test_browserhistory/test_remove/" + Math.random());
   await PlacesTestUtils.addVisits(WITNESS_URI);
   Assert.ok(page_in_database(WITNESS_URI), "Witness page added");
@@ -126,18 +126,17 @@ add_task(async function test_remove_many
   Assert.ok(removed, "Something was removed");
 
   PlacesUtils.history.removeObserver(observer);
 
   do_print("Checking out results");
   // By now the observers should have been called.
   for (let i = 0; i < pages.length; ++i) {
     let page = pages[i];
-    do_print("Page: " + i);
-    Assert.ok(page.onResultCalled, "We have reached the page from the callback");
+    Assert.ok(page.onResultCalled, `We have reached the page #${i} from the callback`);
     Assert.ok(visits_in_database(page.uri) == 0, "History entry has disappeared");
     Assert.equal(page_in_database(page.uri) != 0, page.hasBookmark, "Page is present only if it also has bookmarks");
     Assert.equal(page.onFrecencyChangedCalled, page.onDeleteVisitsCalled, "onDeleteVisits was called iff onFrecencyChanged was called");
     Assert.ok(page.onFrecencyChangedCalled ^ page.onDeleteURICalled, "Either onFrecencyChanged or onDeleteURI was called");
   }
 
   Assert.notEqual(visits_in_database(WITNESS_URI), 0, "Witness URI still has visits");
   Assert.notEqual(page_in_database(WITNESS_URI), 0, "Witness URI is still here");