Backed out changeset aa3d11c78ac9 (bug 1366231) for linting failures, e.g. in History.jsm. r=backout
authorSebastian Hengst <archaeopteryx@coole-files.de>
Wed, 07 Jun 2017 18:27:37 +0200
changeset 410943 525fb3e1314b9da3d86c0f68c7bb76301eaae1bb
parent 410942 9b935696d41305da89c147173bca277db6f72dab
child 410944 c8b5660430d2f30569451c216f2b99aedf75bc3a
push id7391
push usermtabara@mozilla.com
push dateMon, 12 Jun 2017 13:08:53 +0000
treeherdermozilla-beta@2191d7f87e2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs1366231
milestone55.0a1
backs outaa3d11c78ac9a7ee493b595e91bf49f4c77e50bc
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 aa3d11c78ac9 (bug 1366231) for linting failures, e.g. in History.jsm. r=backout
toolkit/components/places/History.jsm
toolkit/components/places/tests/history/test_hasVisits.js
--- a/toolkit/components/places/History.jsm
+++ b/toolkit/components/places/History.jsm
@@ -509,34 +509,31 @@ this.History = Object.freeze({
       "History.jsm: removeByFilter",
       db => removeByFilter(db, filter, onResult)
     );
   },
 
   /**
    * Determine if a page has been visited.
    *
-   * @param guidOrURI: (string) or (URL, nsIURI or href)
-   *      Either the full URI of the page or the GUID of the page.
+   * @param pages: (URL or nsIURI)
+   *      The full URI of the page.
+   *            or (string)
+   *      The full URI of the page or the GUID of the page.
+   *
    * @return (Promise)
    *      A promise resolved once the operation is complete.
    * @resolve (bool)
    *      `true` if the page has been visited, `false` otherwise.
    * @throws (Error)
-   *      If `guidOrURI` has an unexpected type or if a string provided
+   *      If `pages` has an unexpected type or if a string provided
    *      is neither not a valid GUID nor a valid URI.
    */
-  hasVisits(guidOrURI) {
-    guidOrURI = PlacesUtils.normalizeToURLOrGUID(guidOrURI);
-
-    return new Promise(resolve => {
-      PlacesUtils.asyncHistory.isURIVisited(guidOrURI, (aURI, aIsVisited) => {
-        resolve(aIsVisited);
-      });
-    });
+  hasVisits(page, onResult) {
+    throw new Error("Method not implemented");
   },
 
   /**
    * Clear all history.
    *
    * @return (Promise)
    *      A promise resolved once the operation is complete.
    */
@@ -1250,9 +1247,9 @@ var insertMany = async function(db, page
         if (updatedCount > 0) {
           resolve();
         } else {
           reject({message: "No items were added to history."})
         }
       }
     }, true);
   });
-};
\ No newline at end of file
+};
deleted file mode 100644
--- a/toolkit/components/places/tests/history/test_hasVisits.js
+++ /dev/null
@@ -1,36 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
-   http://creativecommons.org/publicdomain/zero/1.0/ */
-
-// Tests for `History.hasVisits` as implemented in History.jsm
-
-"use strict";
-
-add_task(async function test_has_visits_error_cases() {
-  Assert.throws(
-    () => PlacesUtils.history.hasVisits(),
-    /TypeError: Invalid url or guid: undefined/,
-    "passing a null into History.hasVisits should throw a TypeError"
-  );
-  Assert.throws(
-    () => PlacesUtils.history.hasVisits(1),
-    /TypeError: Invalid url or guid: 1/,
-    "passing an invalid url into History.hasVisits should throw a TypeError"
-  );
-  Assert.throws(
-    () => PlacesUtils.history.hasVisits({}),
-    /TypeError: Invalid url or guid: [object Object]/,
-    `passing an invalid (not of type URI or nsIURI) object to History.hasVisits
-     should throw a TypeError`
-  );
-});
-
-add_task(async function test_history_has_visits() {
-  const TEST_URL = "http://mozilla.com/";
-  await PlacesTestUtils.clearHistory();
-  Assert.equal(await PlacesUtils.history.hasVisits(TEST_URL), false,
-               "Test Url should not be in history.");
-  await PlacesTestUtils.addVisits(TEST_URL);
-  Assert.equal(await PlacesUtils.history.hasVisits(TEST_URL), true,
-               "Test Url should be in history.");
-  await PlacesTestUtils.clearHistory();
-});
\ No newline at end of file