Backed out changeset 38bbf2279a94 (bug 1343182) for timeouts in test_automigration.js and test_PlacesProvider.js
authorPhil Ringnalda <philringnalda@gmail.com>
Fri, 07 Apr 2017 07:56:18 -0700
changeset 351778 1aa2b156d8f4
parent 351777 284cfa16fa6e
child 351780 d8aae9ac9102
push id40305
push userphilringnalda@gmail.com
push dateFri, 07 Apr 2017 14:56:31 +0000
treeherderautoland@1aa2b156d8f4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1343182
milestone55.0a1
backs out38bbf2279a94
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
Backed out changeset 38bbf2279a94 (bug 1343182) for timeouts in test_automigration.js and test_PlacesProvider.js CLOSED TREE
toolkit/components/places/History.jsm
toolkit/components/places/tests/history/test_insertMany.js
--- a/toolkit/components/places/History.jsm
+++ b/toolkit/components/places/History.jsm
@@ -1030,22 +1030,20 @@ var insertMany = Task.async(function*(db
       handleError: (resultCode, result) => {
         let pageInfo = mergeUpdateInfoIntoPageInfo(result);
         onErrorData.push(pageInfo);
       },
       handleResult: result => {
         let pageInfo = mergeUpdateInfoIntoPageInfo(result);
         onResultData.push(pageInfo);
       },
-      ignoreErrors: !onError,
-      ignoreResults: !onResult,
-      handleCompletion: (updatedCount) => {
+      handleCompletion: () => {
         notifyOnResult(onResultData, onResult);
         notifyOnResult(onErrorData, onError);
-        if (updatedCount > 0) {
+        if (onResultData.length) {
           resolve();
         } else {
           reject({message: "No items were added to history."})
         }
       }
-    }, true);
+    });
   });
 });
--- a/toolkit/components/places/tests/history/test_insertMany.js
+++ b/toolkit/components/places/tests/history/test_insertMany.js
@@ -48,31 +48,16 @@ add_task(function* test_insertMany() {
 
       pageInfo.url = yield filter(uri);
       pageInfos.push(pageInfo);
     }
     return pageInfos;
   });
 
   let inserter = Task.async(function*(name, filter, useCallbacks) {
-    function promiseManyFrecenciesChanged() {
-      return new Promise((resolve, reject) => {
-        let obs = new NavHistoryObserver();
-        obs.onManyFrecenciesChanged = () => {
-          PlacesUtils.history.removeObserver(obs);
-          resolve();
-        };
-        obs.onFrecencyChanged = () => {
-          PlacesUtils.history.removeObserver(obs);
-          reject();
-        };
-        PlacesUtils.history.addObserver(obs, false);
-      });
-    }
-
     do_print(name);
     do_print(`filter: ${filter}`);
     do_print(`useCallbacks: ${useCallbacks}`);
     yield PlacesTestUtils.clearHistory();
 
     let result;
     let allUrls = GOOD_URLS.concat(BAD_URLS);
     let pageInfos = yield makePageInfos(allUrls, filter);
@@ -91,19 +76,17 @@ add_task(function* test_insertMany() {
         Assert.ok(BAD_URLS.includes(url), "onError callback called for correct uri");
         onErrorUrls.push(url);
         Assert.equal(undefined, pageInfo.title, "onError callback provides the correct title");
         Assert.equal(undefined, pageInfo.guid, "onError callback provides the expected guid");
       });
       Assert.equal(GOOD_URLS.sort().toString(), onResultUrls.sort().toString(), "onResult callback was called for each good url");
       Assert.equal(BAD_URLS.sort().toString(), onErrorUrls.sort().toString(), "onError callback was called for each bad url");
     } else {
-      let promiseManyFrecencies = promiseManyFrecenciesChanged();
       result = yield PlacesUtils.history.insertMany(pageInfos);
-      yield promiseManyFrecencies;
     }
 
     Assert.equal(undefined, result, "insertMany returned undefined");
 
     for (let url of allUrls) {
       let expected = GOOD_URLS.includes(url);
       Assert.equal(expected, yield PlacesTestUtils.isPageInDB(url), `isPageInDB for ${url} is ${expected}`);
       Assert.equal(expected, yield PlacesTestUtils.visitsInDB(url), `visitsInDB for ${url} is ${expected}`);