Bug 1479722 - Rework PlacesUtils.setCharsetForURI to PlacesUIUtils.setCharsetForPage and avoid main thread sync io. r=mak
authorMark Banner <standard8@mozilla.com>
Wed, 01 Aug 2018 10:13:59 +0000
changeset 429587 26c498b422ebbb46156d2cac048d6441c2715631
parent 429586 d7aac87e2db54dc57b951e63079f053df49a50ef
child 429588 fde7e80c27a764a0b28ca79615515f8da70471cf
push id67176
push usermbanner@mozilla.com
push dateWed, 01 Aug 2018 10:51:50 +0000
treeherderautoland@26c498b422eb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmak
bugs1479722
milestone63.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 1479722 - Rework PlacesUtils.setCharsetForURI to PlacesUIUtils.setCharsetForPage and avoid main thread sync io. r=mak MozReview-Commit-ID: HeO3Mm5Dibo Differential Revision: https://phabricator.services.mozilla.com/D2582
browser/base/content/browser-places.js
browser/base/content/browser.js
browser/components/places/PlacesUIUtils.jsm
browser/components/places/content/bookmarkProperties.js
browser/components/places/tests/unit/test_PUIU_setCharsetForPage.js
browser/components/places/tests/unit/xpcshell.ini
toolkit/components/places/Bookmarks.jsm
toolkit/components/places/PlacesUtils.jsm
toolkit/components/places/tests/bookmarks/test_1129529.js
toolkit/components/places/tests/unit/test_317472.js
toolkit/components/places/tests/unit/test_bookmarks_html_escape_entities.js
toolkit/components/places/tests/unit/test_promiseBookmarksTree.js
toolkit/components/places/tests/unit/xpcshell.ini
--- a/browser/base/content/browser-places.js
+++ b/browser/base/content/browser-places.js
@@ -394,19 +394,18 @@ var PlacesCommandHook = {
         // If we bookmark the page here but open right into a cancelable
         // state (i.e. new bookmark in Library), start batching here so
         // all of the actions can be undone in a single undo step.
         StarUI.beginBatch();
       }
 
       info.guid = await PlacesTransactions.NewBookmark(info).transact();
 
-      // Set the character-set
-      if (charset && !PrivateBrowsingUtils.isBrowserPrivate(browser)) {
-        PlacesUtils.setCharsetForURI(makeURI(url.href), charset);
+      if (charset) {
+        PlacesUIUtils.setCharsetForPage(url, charset, window).catch(Cu.reportError);
       }
     }
 
     // Revert the contents of the location bar
     gURLBar.handleRevert();
 
     // If it was not requested to open directly in "edit" mode, we are done.
     if (!showEditUI) {
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -6220,18 +6220,19 @@ function handleDroppedLink(event, urlOrL
     event.preventDefault();
   }
 }
 
 function BrowserSetForcedCharacterSet(aCharset) {
   if (aCharset) {
     gBrowser.selectedBrowser.characterSet = aCharset;
     // Save the forced character-set
-    if (!PrivateBrowsingUtils.isWindowPrivate(window))
-      PlacesUtils.setCharsetForURI(getWebNavigation().currentURI, aCharset);
+    PlacesUIUtils.setCharsetForPage(getWebNavigation().currentURI,
+                                    aCharset,
+                                    window).catch(Cu.reportError);
   }
   BrowserCharsetReload();
 }
 
 function BrowserCharsetReload() {
   BrowserReloadWithFlags(Ci.nsIWebNavigation.LOAD_FLAGS_CHARSET_CHANGE);
 }
 
@@ -8239,9 +8240,8 @@ var ConfirmationHint = {
     return this._animationBox = document.getElementById("confirmation-hint-checkmark-animation-container");
   },
 
   get _message() {
     delete this._message;
     return this._message = document.getElementById("confirmation-hint-message");
   },
 };
-
--- a/browser/components/places/PlacesUIUtils.jsm
+++ b/browser/components/places/PlacesUIUtils.jsm
@@ -455,16 +455,42 @@ var PlacesUIUtils = {
    * This is actually used to distinguish user-initiated visits in frames
    * so automatic visits can be correctly ignored.
    */
   markPageAsFollowedLink: function PUIU_markPageAsFollowedLink(aURL) {
     PlacesUtils.history.markPageAsFollowedLink(this.createFixedURI(aURL));
   },
 
   /**
+   * Sets the character-set for a page. The character set will not be saved
+   * if the window is determined to be a private browsing window.
+   *
+   * @param {string|URL|nsIURI} url The URL of the page to set the charset on.
+   * @param {String} charset character-set value.
+   * @param {window} window The window that the charset is being set from.
+   * @return {Promise}
+   */
+  async setCharsetForPage(url, charset, window) {
+    if (PrivateBrowsingUtils.isWindowPrivate(window)) {
+      return;
+    }
+
+    // UTF-8 is the default. If we are passed the value then set it to null,
+    // to ensure any charset is removed from the database.
+    if (charset.toLowerCase() == "utf-8") {
+      charset = null;
+    }
+
+    await PlacesUtils.history.update({
+      url,
+      annotations: new Map([[PlacesUtils.CHARSET_ANNO, charset]])
+    });
+  },
+
+  /**
    * Allows opening of javascript/data URI only if the given node is
    * bookmarked (see bug 224521).
    * @param aURINode
    *        a URI node
    * @param aWindow
    *        a window on which a potential error alert is shown on.
    * @return true if it's safe to open the node in the browser, false otherwise.
    *
--- a/browser/components/places/content/bookmarkProperties.js
+++ b/browser/components/places/content/bookmarkProperties.js
@@ -463,18 +463,19 @@ var BookmarkPropertiesPanel = {
     let info = { parentGuid, index, title: this._title };
     if (this._itemType == BOOKMARK_ITEM) {
       info.url = this._uri;
       if (this._keyword)
         info.keyword = this._keyword;
       if (this._postData)
         info.postData = this._postData;
 
-      if (this._charSet && !PrivateBrowsingUtils.isWindowPrivate(window))
-        PlacesUtils.setCharsetForURI(this._uri, this._charSet);
+      if (this._charSet) {
+        PlacesUIUtils.setCharsetForPage(this._uri, this._charSet, window).catch(Cu.reportError);
+      }
 
       itemGuid = await PlacesTransactions.NewBookmark(info).transact();
     } else if (this._itemType == LIVEMARK_CONTAINER) {
       info.feedUrl = this._feedURI;
       if (this._siteURI)
         info.siteUrl = this._siteURI;
 
       itemGuid = await PlacesTransactions.NewLivemark(info).transact();
new file mode 100644
--- /dev/null
+++ b/browser/components/places/tests/unit/test_PUIU_setCharsetForPage.js
@@ -0,0 +1,101 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* vim:set ts=2 sw=2 sts=2 et: */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+const {PrivateBrowsingUtils} =
+  ChromeUtils.import("resource://gre/modules/PrivateBrowsingUtils.jsm", {});
+
+const UTF8 = "UTF-8";
+const UTF16 = "UTF-16";
+const CHARSET_ANNO = PlacesUtils.CHARSET_ANNO;
+
+const TEST_URI = "http://foo.com";
+const TEST_BOOKMARKED_URI = "http://bar.com";
+
+add_task(function setup() {
+  let savedIsWindowPrivateFunc = PrivateBrowsingUtils.isWindowPrivate;
+  PrivateBrowsingUtils.isWindowPrivate = () => false;
+
+  registerCleanupFunction(() => {
+    PrivateBrowsingUtils.isWindowPrivate = savedIsWindowPrivateFunc;
+  });
+});
+
+add_task(async function test_simple_add() {
+  // add pages to history
+  await PlacesTestUtils.addVisits(TEST_URI);
+  await PlacesTestUtils.addVisits(TEST_BOOKMARKED_URI);
+
+  // create bookmarks on TEST_BOOKMARKED_URI
+  await PlacesUtils.bookmarks.insert({
+    parentGuid: PlacesUtils.bookmarks.unfiledGuid,
+    url: TEST_BOOKMARKED_URI,
+    title: TEST_BOOKMARKED_URI.spec,
+  });
+  await PlacesUtils.bookmarks.insert({
+    parentGuid: PlacesUtils.bookmarks.toolbarGuid,
+    url: TEST_BOOKMARKED_URI,
+    title: TEST_BOOKMARKED_URI.spec,
+  });
+
+  // set charset on not-bookmarked page
+  await PlacesUIUtils.setCharsetForPage(TEST_URI, UTF16, {});
+  // set charset on bookmarked page
+  await PlacesUIUtils.setCharsetForPage(TEST_BOOKMARKED_URI, UTF16, {});
+
+  let pageInfo = await PlacesUtils.history.fetch(TEST_URI, {includeAnnotations: true});
+  Assert.equal(pageInfo.annotations.get(PlacesUtils.CHARSET_ANNO), UTF16,
+    "Should return correct charset for a not-bookmarked page");
+
+  pageInfo = await PlacesUtils.history.fetch(TEST_BOOKMARKED_URI, {includeAnnotations: true});
+  Assert.equal(pageInfo.annotations.get(PlacesUtils.CHARSET_ANNO), UTF16,
+    "Should return correct charset for a bookmarked page");
+
+  await PlacesUtils.history.clear();
+
+  pageInfo = await PlacesUtils.history.fetch(TEST_URI, {includeAnnotations: true});
+  Assert.ok(!pageInfo, "Should not return pageInfo for a page after history cleared");
+
+  pageInfo = await PlacesUtils.history.fetch(TEST_BOOKMARKED_URI, {includeAnnotations: true});
+  Assert.equal(pageInfo.annotations.get(PlacesUtils.CHARSET_ANNO), UTF16,
+    "Charset should still be set for a bookmarked page after history clear");
+
+  await PlacesUIUtils.setCharsetForPage(TEST_BOOKMARKED_URI, "");
+  pageInfo = await PlacesUtils.history.fetch(TEST_BOOKMARKED_URI, {includeAnnotations: true});
+  Assert.strictEqual(pageInfo.annotations.get(PlacesUtils.CHARSET_ANNO), undefined,
+    "Should not have a charset after it has been removed from the page");
+});
+
+add_task(async function test_utf8_clears_saved_anno() {
+  await PlacesUtils.history.clear();
+  await PlacesTestUtils.addVisits(TEST_URI);
+
+  // set charset on bookmarked page
+  await PlacesUIUtils.setCharsetForPage(TEST_URI, UTF16, {});
+
+  let pageInfo = await PlacesUtils.history.fetch(TEST_URI, {includeAnnotations: true});
+  Assert.equal(pageInfo.annotations.get(PlacesUtils.CHARSET_ANNO), UTF16,
+    "Should return correct charset for a not-bookmarked page");
+
+  // Now set the bookmark to a UTF-8 charset.
+  await PlacesUIUtils.setCharsetForPage(TEST_URI, UTF8, {});
+
+  pageInfo = await PlacesUtils.history.fetch(TEST_URI, {includeAnnotations: true});
+  Assert.strictEqual(pageInfo.annotations.get(PlacesUtils.CHARSET_ANNO), undefined,
+    "Should have removed the charset for a UTF-8 page.");
+});
+
+add_task(async function test_private_browsing_not_saved() {
+  await PlacesUtils.history.clear();
+  await PlacesTestUtils.addVisits(TEST_URI);
+
+  // set charset on bookmarked page, but pretend this is a private browsing window.
+  PrivateBrowsingUtils.isWindowPrivate = () => true;
+  await PlacesUIUtils.setCharsetForPage(TEST_URI, UTF16, {});
+
+  let pageInfo = await PlacesUtils.history.fetch(TEST_URI, {includeAnnotations: true});
+  Assert.strictEqual(pageInfo.annotations.get(PlacesUtils.CHARSET_ANNO), undefined,
+    "Should not have set the charset in a private browsing window.");
+});
--- a/browser/components/places/tests/unit/xpcshell.ini
+++ b/browser/components/places/tests/unit/xpcshell.ini
@@ -13,8 +13,9 @@ support-files =
 [test_browserGlue_corrupt_nobackup.js]
 [test_browserGlue_corrupt_nobackup_default.js]
 [test_browserGlue_distribution.js]
 [test_browserGlue_migrate.js]
 [test_browserGlue_prefs.js]
 [test_browserGlue_restore.js]
 [test_clearHistory_shutdown.js]
 [test_PUIU_batchUpdatesForNode.js]
+[test_PUIU_setCharsetForPage.js]
--- a/toolkit/components/places/Bookmarks.jsm
+++ b/toolkit/components/places/Bookmarks.jsm
@@ -1390,17 +1390,17 @@ var Bookmarks = Object.freeze({
     let db = await PlacesUtils.promiseDBConnection();
     let rows = await db.executeCached(`
       SELECT b.title AS name, count(*) AS count
       FROM moz_bookmarks b
       JOIN moz_bookmarks p ON b.parent = p.id
       JOIN moz_bookmarks c ON c.parent = b.id
       WHERE p.guid = :tagsGuid
       GROUP BY name
-      ORDER BY name COLLATE nocase ASC 
+      ORDER BY name COLLATE nocase ASC
     `, { tagsGuid: this.tagsGuid });
     return rows.map(r => ({
       name: r.getResultByName("name"),
       count: r.getResultByName("count")
     }));
   },
 
   /**
@@ -1942,17 +1942,27 @@ async function handleBookmarkItemSpecial
       PlacesUtils.tagging.tagURI(NetUtil.newURI(item.url), item.tags, item.source);
     } catch (ex) {
       // Invalid tag child, skip it.
       Cu.reportError(`Unable to set tags "${item.tags.join(", ")}" for ${item.url}: ${ex}`);
     }
   }
   if ("charset" in item && item.charset) {
     try {
-      await PlacesUtils.setCharsetForURI(NetUtil.newURI(item.url), item.charset);
+      // UTF-8 is the default. If we are passed the value then set it to null,
+      // to ensure any charset is removed from the database.
+      let charset = item.charset;
+      if (item.charset.toLowerCase() == "utf-8") {
+        charset = null;
+      }
+
+      await PlacesUtils.history.update({
+        url: item.url,
+        annotations: new Map([[PlacesUtils.CHARSET_ANNO, charset]])
+      });
     } catch (ex) {
       Cu.reportError(`Failed to set charset "${item.charset}" for ${item.url}: ${ex}`);
     }
   }
 }
 
 // Query implementation.
 
--- a/toolkit/components/places/PlacesUtils.jsm
+++ b/toolkit/components/places/PlacesUtils.jsm
@@ -1480,41 +1480,16 @@ var PlacesUtils = {
     if (!name) {
       throw new TypeError("Expecting a user-readable name");
     }
     let db = await gAsyncDBWrapperPromised;
     return db.executeBeforeShutdown(name, task);
   },
 
   /**
-   * Sets the character-set for a URI.
-   *
-   * @param {nsIURI} aURI
-   * @param {String} aCharset character-set value.
-   * @return {Promise}
-   */
-  setCharsetForURI: function PU_setCharsetForURI(aURI, aCharset) {
-    return new Promise(resolve => {
-      // Delaying to catch issues with asynchronous behavior while waiting
-      // to implement asynchronous annotations in bug 699844.
-      Services.tm.dispatchToMainThread(function() {
-        if (aCharset && aCharset.length > 0) {
-          PlacesUtils.annotations.setPageAnnotation(
-            aURI, PlacesUtils.CHARSET_ANNO, aCharset, 0,
-            Ci.nsIAnnotationService.EXPIRE_NEVER);
-        } else {
-          PlacesUtils.annotations.removePageAnnotation(
-            aURI, PlacesUtils.CHARSET_ANNO);
-        }
-        resolve();
-      });
-    });
-  },
-
-  /**
    * Gets favicon data for a given page url.
    *
    * @param aPageUrl url of the page to look favicon for.
    * @resolves to an object representing a favicon entry, having the following
    *           properties: { uri, dataLen, data, mimeType }
    * @rejects JavaScript exception if the given url has no associated favicon.
    */
   promiseFaviconData(aPageUrl) {
--- a/toolkit/components/places/tests/bookmarks/test_1129529.js
+++ b/toolkit/components/places/tests/bookmarks/test_1129529.js
@@ -19,39 +19,39 @@ add_task(async function() {
       dateAdded: now,
       lastModified: now,
       root: "unfiledBookmarksFolder",
       children: [
         {
           guid: "___guid1____",
           index: 0,
           id: 3,
-          charset: "UTF-8",
+          charset: "UTF-16",
           tags: "tag0",
           type: "text/x-moz-place",
           dateAdded: now,
           lastModified: now,
           uri: "http://test0.com/"
         },
         {
           guid: "___guid2____",
           index: 1,
           id: 4,
-          charset: "UTF-8",
+          charset: "UTF-16",
           tags: "tag1,a" + "0123456789".repeat(10), // 101 chars
           type: "text/x-moz-place",
           dateAdded: now,
           lastModified: now,
           uri: "http://test1.com/"
         },
         {
           guid: "___guid3____",
           index: 2,
           id: 5,
-          charset: "UTF-8",
+          charset: "UTF-16",
           tags: "tag2",
           type: "text/x-moz-place",
           dateAdded: now,
           lastModified: now,
           uri: "http://test2.com/"
         }
       ]
     }]
@@ -62,15 +62,15 @@ add_task(async function() {
   await BookmarkJSONUtils.importFromURL(uri);
 
   let [bookmarks] = await PlacesBackups.getBookmarksTree();
   let unsortedBookmarks = bookmarks.children[2].children;
   Assert.equal(unsortedBookmarks.length, 3);
 
   for (let i = 0; i < unsortedBookmarks.length; ++i) {
     let bookmark = unsortedBookmarks[i];
-    Assert.equal(bookmark.charset, "UTF-8");
+    Assert.equal(bookmark.charset, "UTF-16");
     Assert.equal(bookmark.dateAdded, now);
     Assert.equal(bookmark.lastModified, now);
     Assert.equal(bookmark.uri, "http://test" + i + ".com/");
     Assert.equal(bookmark.tags, "tag" + i);
   }
 });
deleted file mode 100644
--- a/toolkit/components/places/tests/unit/test_317472.js
+++ /dev/null
@@ -1,65 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-const charset = "UTF-8";
-const CHARSET_ANNO = PlacesUtils.CHARSET_ANNO;
-
-const TEST_URI = uri("http://foo.com");
-const TEST_BOOKMARKED_URI = uri("http://bar.com");
-
-add_task(async function test_execute() {
-  // add pages to history
-  await PlacesTestUtils.addVisits(TEST_URI);
-  await PlacesTestUtils.addVisits(TEST_BOOKMARKED_URI);
-
-  // create bookmarks on TEST_BOOKMARKED_URI
-  await PlacesUtils.bookmarks.insert({
-    parentGuid: PlacesUtils.bookmarks.unfiledGuid,
-    url: TEST_BOOKMARKED_URI,
-    title: TEST_BOOKMARKED_URI.spec,
-  });
-  await PlacesUtils.bookmarks.insert({
-    parentGuid: PlacesUtils.bookmarks.toolbarGuid,
-    url: TEST_BOOKMARKED_URI,
-    title: TEST_BOOKMARKED_URI.spec,
-  });
-
-  // set charset on not-bookmarked page
-  await PlacesUtils.setCharsetForURI(TEST_URI, charset);
-  // set charset on bookmarked page
-  await PlacesUtils.setCharsetForURI(TEST_BOOKMARKED_URI, charset);
-
-  // check that we have created a page annotation
-  Assert.equal(PlacesUtils.annotations.getPageAnnotation(TEST_URI, CHARSET_ANNO), charset);
-
-  let pageInfo = await PlacesUtils.history.fetch(TEST_URI, {includeAnnotations: true});
-  Assert.equal(pageInfo.annotations.get(PlacesUtils.CHARSET_ANNO), charset,
-    "Should return correct charset for a not-bookmarked page");
-
-  pageInfo = await PlacesUtils.history.fetch(TEST_BOOKMARKED_URI, {includeAnnotations: true});
-  Assert.equal(pageInfo.annotations.get(PlacesUtils.CHARSET_ANNO), charset,
-    "Should return correct charset for a bookmarked page");
-
-  await PlacesUtils.history.clear();
-
-  pageInfo = await PlacesUtils.history.fetch(TEST_URI, {includeAnnotations: true});
-  Assert.ok(!pageInfo, "Should not return pageInfo for a page after history cleared");
-
-  // check that page annotation has been removed
-  try {
-    PlacesUtils.annotations.getPageAnnotation(TEST_URI, CHARSET_ANNO);
-    do_throw("Charset page annotation has not been removed correctly");
-  } catch (e) {}
-
-  pageInfo = await PlacesUtils.history.fetch(TEST_BOOKMARKED_URI, {includeAnnotations: true});
-  Assert.equal(pageInfo.annotations.get(PlacesUtils.CHARSET_ANNO), charset,
-    "Charset should still be set for a bookmarked page after history clear");
-
-  await PlacesUtils.setCharsetForURI(TEST_BOOKMARKED_URI, "");
-  pageInfo = await PlacesUtils.history.fetch(TEST_BOOKMARKED_URI, {includeAnnotations: true});
-  Assert.notEqual(pageInfo.annotations.get(PlacesUtils.CHARSET_ANNO), charset,
-    "Should not have a charset after it has been removed from the page");
-});
--- a/toolkit/components/places/tests/unit/test_bookmarks_html_escape_entities.js
+++ b/toolkit/components/places/tests/unit/test_bookmarks_html_escape_entities.js
@@ -20,19 +20,21 @@ add_task(async function() {
   // Adds bookmarks and tags to the database.
   const url = 'http://www.google.it/"/';
   let bm = await PlacesUtils.bookmarks.insert({
     parentGuid: PlacesUtils.bookmarks.unfiledGuid,
     url,
     title: unescaped
   });
   await PlacesUtils.keywords.insert({ url, keyword: unescaped, postData: unescaped });
-  let uri = Services.io.newURI(url);
-  PlacesUtils.tagging.tagURI(uri, [unescaped]);
-  await PlacesUtils.setCharsetForURI(uri, unescaped);
+  PlacesUtils.tagging.tagURI(Services.io.newURI(url), [unescaped]);
+  await PlacesUtils.history.update({
+    url,
+    annotations: new Map([[PlacesUtils.CHARSET_ANNO, unescaped]]),
+  });
   PlacesUtils.annotations.setItemAnnotation(
     await PlacesUtils.promiseItemId(bm.guid),
     DESCRIPTION_ANNO, unescaped, 0, PlacesUtils.annotations.EXPIRE_NEVER);
 
   // Exports the bookmarks as a HTML file.
   await BookmarkHTMLUtils.exportToFile(HTMLFile);
   await PlacesUtils.bookmarks.remove(bm);
 
--- a/toolkit/components/places/tests/unit/test_promiseBookmarksTree.js
+++ b/toolkit/components/places/tests/unit/test_promiseBookmarksTree.js
@@ -207,17 +207,20 @@ add_task(async function() {
   let folderGuid = await new_folder({ parentGuid: PlacesUtils.bookmarks.menuGuid });
   await new_bookmark({ title: null,
                        parentGuid: folderGuid,
                        keyword: "test_keyword",
                        tags: ["TestTagA", "TestTagB"],
                        annotations: [{ name: "TestAnnoA", value: "TestVal2"}]});
   let urlWithCharsetAndFavicon = uri("http://charset.and.favicon");
   await new_bookmark({ parentGuid: folderGuid, url: urlWithCharsetAndFavicon });
-  await PlacesUtils.setCharsetForURI(urlWithCharsetAndFavicon, "UTF-8");
+  await PlacesUtils.history.update({
+    url: urlWithCharsetAndFavicon,
+    annotations: new Map([[PlacesUtils.CHARSET_ANNO, "UTF-16"]]),
+  });
   await setFaviconForPage(urlWithCharsetAndFavicon, SMALLPNG_DATA_URI);
   // Test the default places root without specifying it.
   await test_promiseBookmarksTreeAgainstResult();
 
   // Do specify it
   await test_promiseBookmarksTreeAgainstResult(PlacesUtils.bookmarks.rootGuid);
 
   // Exclude the bookmarks menu.
--- a/toolkit/components/places/tests/unit/xpcshell.ini
+++ b/toolkit/components/places/tests/unit/xpcshell.ini
@@ -11,17 +11,16 @@ support-files =
   mobile_bookmarks_folder_import.json
   mobile_bookmarks_folder_merge.json
   mobile_bookmarks_multiple_folders.json
   mobile_bookmarks_root_import.json
   mobile_bookmarks_root_merge.json
   places.sparse.sqlite
 
 [test_000_frecency.js]
-[test_317472.js]
 [test_331487.js]
 [test_384370.js]
 [test_385397.js]
 [test_399266.js]
 skip-if = os == "linux" # Bug 821781
 [test_402799.js]
 [test_408221.js]
 [test_412132.js]