Bug 1383027 - Remove a test use of PlacesUtils.getBookmarksForURI. r=past
authorMarco Bonardo <mbonardo@mozilla.com>
Fri, 21 Jul 2017 13:50:06 +0200
changeset 418887 095cbbcf0240ae8465377992175744079df45da5
parent 418886 d941b592133f9e0aabe24a4f35078445e7aeace0
child 418888 4e853e81c2be70c041fbae19e4e30dc7e97e86c2
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspast
bugs1383027
milestone56.0a1
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
Bug 1383027 - Remove a test use of PlacesUtils.getBookmarksForURI. r=past MozReview-Commit-ID: FLiqzgoTTHZ
toolkit/components/places/tests/bookmarks/test_keywords.js
--- a/toolkit/components/places/tests/bookmarks/test_keywords.js
+++ b/toolkit/components/places/tests/bookmarks/test_keywords.js
@@ -1,18 +1,21 @@
 const URI1 = NetUtil.newURI("http://test1.mozilla.org/");
 const URI2 = NetUtil.newURI("http://test2.mozilla.org/");
 const URI3 = NetUtil.newURI("http://test3.mozilla.org/");
 
 async function check_keyword(aURI, aKeyword) {
   if (aKeyword)
     aKeyword = aKeyword.toLowerCase();
 
-  for (let bm of PlacesUtils.getBookmarksForURI(aURI)) {
-    let keyword = PlacesUtils.bookmarks.getKeywordForBookmark(bm);
+  let bms = [];
+  await PlacesUtils.bookmarks.fetch({ url: aURI }, bm => bms.push(bm));
+  for (let bm of bms) {
+    let itemId = await PlacesUtils.promiseItemId(bm.guid);
+    let keyword = PlacesUtils.bookmarks.getKeywordForBookmark(itemId);
     if (keyword && !aKeyword) {
       throw (`${aURI.spec} should not have a keyword`);
     } else if (aKeyword && keyword == aKeyword) {
       Assert.equal(keyword, aKeyword);
     }
   }
 
   if (aKeyword) {