Backed out changeset eeb6bc8a42e6 (bug 1288885)
authorSebastian Hengst <archaeopteryx@coole-files.de>
Thu, 28 Jul 2016 10:06:33 +0200
changeset 332077 0391561d533b6131fddacb3939208f85f1b966e0
parent 332076 0cd3154a94eb67a71fcacf70537b70a88d4baf04
child 332078 6254ca38371816e02e356e5a3a2067c4e1af3128
push id9858
push userjlund@mozilla.com
push dateMon, 01 Aug 2016 14:37:10 +0000
treeherdermozilla-aurora@203106ef6cb6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1288885
milestone50.0a1
backs outeeb6bc8a42e69e989bb70cc6daf56296936f60b0
Backed out changeset eeb6bc8a42e6 (bug 1288885)
browser/components/extensions/test/browser/browser.ini
browser/components/extensions/test/browser/browser_ext_history.js
browser/components/extensions/test/xpcshell/test_ext_history.js
browser/components/extensions/test/xpcshell/xpcshell.ini
--- a/browser/components/extensions/test/browser/browser.ini
+++ b/browser/components/extensions/test/browser/browser.ini
@@ -30,16 +30,17 @@ support-files =
 [browser_ext_contextMenus.js]
 [browser_ext_contextMenus_checkboxes.js]
 [browser_ext_contextMenus_icons.js]
 [browser_ext_contextMenus_radioGroups.js]
 [browser_ext_contextMenus_uninstall.js]
 [browser_ext_contextMenus_urlPatterns.js]
 [browser_ext_currentWindow.js]
 [browser_ext_getViews.js]
+[browser_ext_history.js]
 [browser_ext_incognito_popup.js]
 [browser_ext_lastError.js]
 [browser_ext_optionsPage_privileges.js]
 [browser_ext_pageAction_context.js]
 [browser_ext_pageAction_popup.js]
 [browser_ext_pageAction_popup_resize.js]
 [browser_ext_pageAction_simple.js]
 [browser_ext_popup_api_injection.js]
rename from browser/components/extensions/test/xpcshell/test_ext_history.js
rename to browser/components/extensions/test/browser/browser_ext_history.js
--- a/browser/components/extensions/test/xpcshell/test_ext_history.js
+++ b/browser/components/extensions/test/browser/browser_ext_history.js
@@ -80,58 +80,58 @@ add_task(function* test_delete() {
       }
     } else {
       pushVisit(visit.visits);
     }
     visits.push(visit);
   }
 
   yield PlacesUtils.history.insertMany(visits);
-  equal((yield PlacesTestUtils.visitsInDB(visits[0].url)), 5, "5 visits for uri found in history database");
+  is(yield PlacesTestUtils.visitsInDB(visits[0].url), 5, "5 visits for uri found in history database");
 
   let testUrl = visits[2].url;
-  ok((yield PlacesTestUtils.isPageInDB(testUrl)), "expected url found in history database");
+  ok(yield PlacesTestUtils.isPageInDB(testUrl), "expected url found in history database");
 
   extension.sendMessage("delete-url", testUrl);
   yield extension.awaitMessage("url-deleted");
-  equal((yield PlacesTestUtils.isPageInDB(testUrl)), false, "expected url not found in history database");
+  is(yield PlacesTestUtils.isPageInDB(testUrl), false, "expected url not found in history database");
 
   // delete 3 of the 5 visits for url 1
   let filter = {
     startTime: visits[0].visits[0].date,
     endTime: visits[0].visits[2].date,
   };
 
   extension.sendMessage("delete-range", filter);
   let removedUrls = yield extension.awaitMessage("range-deleted");
   ok(!removedUrls.includes(visits[0].url), `${visits[0].url} not received by onVisitRemoved`);
-  ok((yield PlacesTestUtils.isPageInDB(visits[0].url)), "expected uri found in history database");
-  equal((yield PlacesTestUtils.visitsInDB(visits[0].url)), 2, "2 visits for uri found in history database");
-  ok((yield PlacesTestUtils.isPageInDB(visits[1].url)), "expected uri found in history database");
-  equal((yield PlacesTestUtils.visitsInDB(visits[1].url)), 1, "1 visit for uri found in history database");
+  ok(yield PlacesTestUtils.isPageInDB(visits[0].url), "expected uri found in history database");
+  is(yield PlacesTestUtils.visitsInDB(visits[0].url), 2, "2 visits for uri found in history database");
+  ok(yield PlacesTestUtils.isPageInDB(visits[1].url), "expected uri found in history database");
+  is(yield PlacesTestUtils.visitsInDB(visits[1].url), 1, "1 visit for uri found in history database");
 
   // delete the rest of the visits for url 1, and the visit for url 2
   filter.startTime = visits[0].visits[0].date;
   filter.endTime = visits[1].visits[0].date;
 
   extension.sendMessage("delete-range", filter);
   yield extension.awaitMessage("range-deleted");
 
-  equal((yield PlacesTestUtils.isPageInDB(visits[0].url)), false, "expected uri not found in history database");
-  equal((yield PlacesTestUtils.visitsInDB(visits[0].url)), 0, "0 visits for uri found in history database");
-  equal((yield PlacesTestUtils.isPageInDB(visits[1].url)), false, "expected uri not found in history database");
-  equal((yield PlacesTestUtils.visitsInDB(visits[1].url)), 0, "0 visits for uri found in history database");
+  is(yield PlacesTestUtils.isPageInDB(visits[0].url), false, "expected uri not found in history database");
+  is(yield PlacesTestUtils.visitsInDB(visits[0].url), 0, "0 visits for uri found in history database");
+  is(yield PlacesTestUtils.isPageInDB(visits[1].url), false, "expected uri not found in history database");
+  is(yield PlacesTestUtils.visitsInDB(visits[1].url), 0, "0 visits for uri found in history database");
 
-  ok((yield PlacesTestUtils.isPageInDB(visits[3].url)), "expected uri found in history database");
+  ok(yield PlacesTestUtils.isPageInDB(visits[3].url), "expected uri found in history database");
 
   extension.sendMessage("delete-all");
   [historyClearedCount, removedUrls] = yield extension.awaitMessage("history-cleared");
-  equal(PlacesUtils.history.hasHistoryEntries, false, "history is empty");
-  equal(historyClearedCount, 2, "onVisitRemoved called for each clearing of history");
-  equal(removedUrls.length, 3, "onVisitRemoved called the expected number of times");
+  is(PlacesUtils.history.hasHistoryEntries, false, "history is empty");
+  is(historyClearedCount, 2, "onVisitRemoved called for each clearing of history");
+  is(removedUrls.length, 3, "onVisitRemoved called the expected number of times");
   for (let i = 1; i < 3; ++i) {
     let url = visits[i].url;
     ok(removedUrls.includes(url), `${url} received by onVisitRemoved`);
   }
   yield extension.unload();
 });
 
 add_task(function* test_search() {
@@ -210,45 +210,45 @@ add_task(function* test_search() {
   });
 
   function findResult(url, results) {
     return results.find(r => r.url === url);
   }
 
   function checkResult(results, url, expectedCount) {
     let result = findResult(url, results);
-    notEqual(result, null, `history.search result was found for ${url}`);
-    equal(result.visitCount, expectedCount, `history.search reports ${expectedCount} visit(s)`);
-    equal(result.title, `test visit for ${url}`, "title for search result is correct");
+    isnot(result, null, `history.search result was found for ${url}`);
+    is(result.visitCount, expectedCount, `history.search reports ${expectedCount} visit(s)`);
+    is(result.title, `test visit for ${url}`, "title for search result is correct");
   }
 
   yield extension.startup();
   yield extension.awaitMessage("ready");
   yield PlacesTestUtils.clearHistory();
 
   yield PlacesUtils.history.insertMany(PAGE_INFOS);
 
   extension.sendMessage("check-history");
 
   let results = yield extension.awaitMessage("empty-search");
-  equal(results.length, 3, "history.search with empty text returned 3 results");
+  is(results.length, 3, "history.search with empty text returned 3 results");
   checkResult(results, SINGLE_VISIT_URL, 1);
   checkResult(results, DOUBLE_VISIT_URL, 2);
   checkResult(results, MOZILLA_VISIT_URL, 1);
 
   results = yield extension.awaitMessage("text-search");
-  equal(results.length, 1, "history.search with specific text returned 1 result");
+  is(results.length, 1, "history.search with specific text returned 1 result");
   checkResult(results, MOZILLA_VISIT_URL, 1);
 
   results = yield extension.awaitMessage("max-results-search");
-  equal(results.length, 1, "history.search with maxResults returned 1 result");
+  is(results.length, 1, "history.search with maxResults returned 1 result");
   checkResult(results, DOUBLE_VISIT_URL, 2);
 
   results = yield extension.awaitMessage("date-range-search");
-  equal(results.length, 2, "history.search with a date range returned 2 result");
+  is(results.length, 2, "history.search with a date range returned 2 result");
   checkResult(results, DOUBLE_VISIT_URL, 2);
   checkResult(results, SINGLE_VISIT_URL, 1);
 
   yield extension.awaitFinish("search");
   yield extension.unload();
   yield PlacesTestUtils.clearHistory();
 });
 
@@ -295,21 +295,21 @@ add_task(function* test_add_url() {
 
   let failTestData = [
     [{transition: "generated"}, "an invalid transition", "|generated| is not a supported transition for history"],
     [{visitTime: Date.now() + 1000000}, "a future date", "cannot be a future date"],
     [{url: "about.config"}, "an invalid url", "about.config is not a valid URL"],
   ];
 
   function* checkUrl(results) {
-    ok((yield PlacesTestUtils.isPageInDB(results.details.url)), `${results.details.url} found in history database`);
+    ok(yield PlacesTestUtils.isPageInDB(results.details.url), `${results.details.url} found in history database`);
     ok(PlacesUtils.isValidGuid(results.result.id), "URL was added with a valid id");
-    equal(results.result.title, results.details.title, "URL was added with the correct title");
+    is(results.result.title, results.details.title, "URL was added with the correct title");
     if (results.details.visitTime) {
-      equal(results.result.lastVisitTime,
+      is(results.result.lastVisitTime,
          Number(ExtensionUtils.normalizeTime(results.details.visitTime)),
          "URL was added with the correct date");
     }
   }
 
   let extension = ExtensionTestUtils.loadExtension({
     manifest: {
       permissions: ["history"],
@@ -453,22 +453,22 @@ add_task(function* test_on_visited() {
 
   yield PlacesUtils.history.insertMany(PAGE_INFOS);
 
   let onVisitedData = yield extension.awaitMessage("on-visited-data");
 
   function checkOnVisitedData(index, expected) {
     let onVisited = onVisitedData[index];
     ok(PlacesUtils.isValidGuid(onVisited.id), "onVisited received a valid id");
-    equal(onVisited.url, expected.url, "onVisited received the expected url");
+    is(onVisited.url, expected.url, "onVisited received the expected url");
     // Title will be blank until bug 1287928 lands
     // https://bugzilla.mozilla.org/show_bug.cgi?id=1287928
-    equal(onVisited.title, "", "onVisited received a blank title");
-    equal(onVisited.lastVisitTime, expected.time, "onVisited received the expected time");
-    equal(onVisited.visitCount, expected.visitCount, "onVisited received the expected visitCount");
+    is(onVisited.title, "", "onVisited received a blank title");
+    is(onVisited.lastVisitTime, expected.time, "onVisited received the expected time");
+    is(onVisited.visitCount, expected.visitCount, "onVisited received the expected visitCount");
   }
 
   let expected = {
     url: PAGE_INFOS[0].url,
     title: PAGE_INFOS[0].title,
     time: PAGE_INFOS[0].visits[0].date.getTime(),
     visitCount: 1,
   };
--- a/browser/components/extensions/test/xpcshell/xpcshell.ini
+++ b/browser/components/extensions/test/xpcshell/xpcshell.ini
@@ -1,8 +1,7 @@
 [DEFAULT]
 head = head.js
 tail =
 firefox-appdir = browser
 
 [test_ext_bookmarks.js]
-[test_ext_history.js]
 [test_ext_manifest_commands.js]