Bug 1293445 - 4 - Remove RESULTS_AS_TAG_CONTENTS. r=standard8 draft
authorMarco Bonardo <mbonardo@mozilla.com>
Tue, 03 Apr 2018 18:32:00 +0200
changeset 778505 930fdffc1b06567a43c7d96dd34172d708a55bf6
parent 778504 a86dfc7d5fd33820af0594b748c98a6f1e3c0e76
child 778506 d9aeaeafa9ebf033ad31645dd3cd01255f2f4fa6
push id105499
push usermak77@bonardo.net
push dateFri, 06 Apr 2018 11:20:04 +0000
reviewersstandard8
bugs1293445
milestone61.0a1
Bug 1293445 - 4 - Remove RESULTS_AS_TAG_CONTENTS. r=standard8 MozReview-Commit-ID: rybSCGrfnf
browser/components/places/content/controller.js
toolkit/components/places/nsINavHistoryService.idl
toolkit/components/places/nsNavHistory.cpp
toolkit/components/places/nsNavHistoryQuery.cpp
toolkit/components/places/nsNavHistoryResult.cpp
toolkit/components/places/tests/queries/test_results-as-tag-contents-query.js
toolkit/components/places/tests/queries/xpcshell.ini
toolkit/components/places/tests/unit/test_resolveNullBookmarkTitles.js
--- a/browser/components/places/content/controller.js
+++ b/browser/components/places/content/controller.js
@@ -793,27 +793,17 @@ PlacesController.prototype = {
       totalItems++;
 
       if (PlacesUtils.nodeIsTagQuery(node.parent)) {
         // This is a uri node inside a tag container.  It needs a special
         // untag transaction.
         let tag = node.parent.title || "";
         if (!tag) {
           // The parent may be the root node, that doesn't have a title.
-          // Until we fix bug 1293445, we have two ways to get tags:
-          if (node.parent.queryOptions.resultType ==
-                Ci.nsINavHistoryQueryOptions.RESULTS_AS_TAG_CONTENTS) {
-            // Get the tag using the bookmarks API.
-            let tagItemId = PlacesUtils.getConcreteItemId(node.parent);
-            let tagGuid = await PlacesUtils.promiseItemGuid(tagItemId);
-            tag = (await PlacesUtils.bookmarks.fetch(tagGuid)).title;
-          } else {
-            // Extract the tag from the query itself.
-            tag = node.parent.query.tags[0];
-          }
+          tag = node.parent.query.tags[0];
         }
         transactions.push(PlacesTransactions.Untag({ urls: [node.uri], tag }));
       } else if (PlacesUtils.nodeIsTagQuery(node) &&
                  node.parent &&
                  PlacesUtils.nodeIsQuery(node.parent) &&
                  PlacesUtils.asQuery(node.parent).queryOptions.resultType ==
                    Ci.nsINavHistoryQueryOptions.RESULTS_AS_TAG_QUERY) {
         // This is a tag container.
--- a/toolkit/components/places/nsINavHistoryService.idl
+++ b/toolkit/components/places/nsINavHistoryService.idl
@@ -953,19 +953,18 @@ interface nsINavHistoryQuery : nsISuppor
   /**
    * Limit results to items that are in all of the given folders.
    */
   void getFolders([optional] out unsigned long count,
                   [retval,array,size_is(count)] out long long folders);
   readonly attribute unsigned long folderCount;
 
   /**
-   * For the special result type RESULTS_AS_TAG_CONTENTS we can define only
-   * one folder that must be a tag folder. This is not recursive so results
-   * will be returned from the first level of that folder.
+   * This is not recursive so results will be returned from the first level of
+   * that folder.
    */
   void setFolders([const,array, size_is(folderCount)] in long long folders,
                   in unsigned long folderCount);
 
   /**
    * Creates a new query item with the same parameters of this one.
    */
   nsINavHistoryQuery clone();
@@ -1054,21 +1053,17 @@ interface nsINavHistoryQueryOptions : ns
    * The node contains information how to load its content:
    * - list of bookmarks with the given tag will be loaded.
    *
    * @note Setting this resultType will force queryType to QUERY_TYPE_BOOKMARKS.
    */
   const unsigned short RESULTS_AS_TAG_QUERY = 6;
 
   /**
-   * This is a container with an URI result type that contains the last
-   * modified bookmarks for the given tag.
-   * Tag folder id must be defined in the query.
-   *
-   * @note Setting this resultType will force queryType to QUERY_TYPE_BOOKMARKS.
+   * DEPRECATED: This exists for Sync and also to avoid reusing this number.
    */
   const unsigned short RESULTS_AS_TAG_CONTENTS = 7;
 
   /**
    * This returns nsINavHistoryQueryResultNode nodes for each top-level bookmark
    * root.
    *
    * @note Setting this resultType will force queryType to QUERY_TYPE_BOOKMARKS.
--- a/toolkit/components/places/nsNavHistory.cpp
+++ b/toolkit/components/places/nsNavHistory.cpp
@@ -1114,19 +1114,17 @@ bool IsOptimizableHistoryQuery(const Ref
 
   return true;
 }
 
 static
 bool NeedToFilterResultSet(const RefPtr<nsNavHistoryQuery>& aQuery,
                            nsNavHistoryQueryOptions *aOptions)
 {
-  uint16_t resultType = aOptions->ResultType();
-  return resultType == nsINavHistoryQueryOptions::RESULTS_AS_TAG_CONTENTS ||
-         aOptions->ExcludeQueries();
+  return aOptions->ExcludeQueries();
 }
 
 // ** Helper class for ConstructQueryString **/
 
 class PlacesSQLQueryBuilder
 {
 public:
   PlacesSQLQueryBuilder(const nsCString& aConditions,
@@ -1225,17 +1223,16 @@ PlacesSQLQueryBuilder::GetQueryString(ns
 nsresult
 PlacesSQLQueryBuilder::Select()
 {
   nsresult rv;
 
   switch (mResultType)
   {
     case nsINavHistoryQueryOptions::RESULTS_AS_URI:
-    case nsINavHistoryQueryOptions::RESULTS_AS_TAG_CONTENTS:
       rv = SelectAsURI();
       NS_ENSURE_SUCCESS(rv, rv);
       break;
 
     case nsINavHistoryQueryOptions::RESULTS_AS_VISIT:
       rv = SelectAsVisit();
       NS_ENSURE_SUCCESS(rv, rv);
       break;
@@ -1294,69 +1291,37 @@ PlacesSQLQueryBuilder::SelectAsURI()
         "FROM moz_places h "
         // WHERE 1 is a no-op since additonal conditions will start with AND.
         "WHERE 1 "
           "{QUERY_OPTIONS_VISITS} {QUERY_OPTIONS_PLACES} "
           "{ADDITIONAL_CONDITIONS} ");
       break;
 
     case nsINavHistoryQueryOptions::QUERY_TYPE_BOOKMARKS:
-      if (mResultType == nsINavHistoryQueryOptions::RESULTS_AS_TAG_CONTENTS) {
-        // Order-by clause is hardcoded because we need to discard duplicates
-        // in FilterResultSet. We will retain only the last modified item,
-        // so we are ordering by place id and last modified to do a faster
-        // filtering.
-        mSkipOrderBy = true;
-
-        GetTagsSqlFragment(history->GetTagsFolder(),
-                           NS_LITERAL_CSTRING("b2.fk"),
-                           mHasSearchTerms,
-                           tagsSqlFragment);
-
-        mQueryString = NS_LITERAL_CSTRING(
-          "SELECT b2.fk, h.url, b2.title AS page_title, "
-            "h.rev_host, h.visit_count, h.last_visit_date, null, b2.id, "
-            "b2.dateAdded, b2.lastModified, b2.parent, ") +
-            tagsSqlFragment + NS_LITERAL_CSTRING(", h.frecency, h.hidden, h.guid, "
-            "null, null, null, b2.guid, b2.position, b2.type, b2.fk "
-          "FROM moz_bookmarks b2 "
-          "JOIN (SELECT b.fk "
-                "FROM moz_bookmarks b "
-                // ADDITIONAL_CONDITIONS will filter on parent.
-                "WHERE b.type = 1 {ADDITIONAL_CONDITIONS} "
-                ") AS seed ON b2.fk = seed.fk "
-          "JOIN moz_places h ON h.id = b2.fk "
-          "WHERE NOT EXISTS ( "
-            "SELECT id FROM moz_bookmarks WHERE id = b2.parent AND parent = ") +
+
+      GetTagsSqlFragment(history->GetTagsFolder(),
+                          NS_LITERAL_CSTRING("b.fk"),
+                          mHasSearchTerms,
+                          tagsSqlFragment);
+      mQueryString = NS_LITERAL_CSTRING(
+        "SELECT b.fk, h.url, b.title AS page_title, "
+          "h.rev_host, h.visit_count, h.last_visit_date, null, b.id, "
+          "b.dateAdded, b.lastModified, b.parent, ") +
+          tagsSqlFragment + NS_LITERAL_CSTRING(", h.frecency, h.hidden, h.guid,"
+          "null, null, null, b.guid, b.position, b.type, b.fk "
+        "FROM moz_bookmarks b "
+        "JOIN moz_places h ON b.fk = h.id "
+        "WHERE NOT EXISTS "
+            "(SELECT id FROM moz_bookmarks "
+              "WHERE id = b.parent AND parent = ") +
                 nsPrintfCString("%" PRId64, history->GetTagsFolder()) +
-          NS_LITERAL_CSTRING(") "
-          "ORDER BY b2.fk DESC, b2.lastModified DESC");
-      }
-      else {
-        GetTagsSqlFragment(history->GetTagsFolder(),
-                           NS_LITERAL_CSTRING("b.fk"),
-                           mHasSearchTerms,
-                           tagsSqlFragment);
-        mQueryString = NS_LITERAL_CSTRING(
-          "SELECT b.fk, h.url, b.title AS page_title, "
-            "h.rev_host, h.visit_count, h.last_visit_date, null, b.id, "
-            "b.dateAdded, b.lastModified, b.parent, ") +
-            tagsSqlFragment + NS_LITERAL_CSTRING(", h.frecency, h.hidden, h.guid,"
-            "null, null, null, b.guid, b.position, b.type, b.fk "
-          "FROM moz_bookmarks b "
-          "JOIN moz_places h ON b.fk = h.id "
-          "WHERE NOT EXISTS "
-              "(SELECT id FROM moz_bookmarks "
-                "WHERE id = b.parent AND parent = ") +
-                  nsPrintfCString("%" PRId64, history->GetTagsFolder()) +
-              NS_LITERAL_CSTRING(") "
-              "AND NOT h.url_hash BETWEEN hash('place', 'prefix_lo') AND "
-                                         "hash('place', 'prefix_hi') "
-            "{ADDITIONAL_CONDITIONS}");
-      }
+            NS_LITERAL_CSTRING(") "
+            "AND NOT h.url_hash BETWEEN hash('place', 'prefix_lo') AND "
+                                        "hash('place', 'prefix_hi') "
+          "{ADDITIONAL_CONDITIONS}");
       break;
 
     default:
       return NS_ERROR_NOT_IMPLEMENTED;
   }
   return NS_OK;
 }
 
@@ -3310,32 +3275,22 @@ nsNavHistory::FilterResultSet(nsNavHisto
                               nsCOMArray<nsNavHistoryResultNode>* aFiltered,
                               const RefPtr<nsNavHistoryQuery>& aQuery,
                               nsNavHistoryQueryOptions *aOptions)
 {
   // parse the search terms
   nsTArray<nsString> terms;
   ParseSearchTermsFromQuery(aQuery, &terms);
 
-  uint16_t resultType = aOptions->ResultType();
   bool excludeQueries = aOptions->ExcludeQueries();
   for (int32_t nodeIndex = 0; nodeIndex < aSet.Count(); nodeIndex++) {
     if (excludeQueries && aSet[nodeIndex]->IsQuery()) {
       continue;
     }
 
-    // RESULTS_AS_TAG_CONTENTS returns a set ordered by place_id and
-    // lastModified. The set may contain duplicate, and to remove them we can
-    // just retain the first result.
-    if (resultType == nsINavHistoryQueryOptions::RESULTS_AS_TAG_CONTENTS &&
-        (!aSet[nodeIndex]->IsURI() ||
-         (nodeIndex > 0 && aSet[nodeIndex]->mURI == aSet[nodeIndex-1]->mURI))) {
-      continue;
-    }
-
     if (aSet[nodeIndex]->mItemId != -1 && aQueryNode &&
         aQueryNode->mItemId == aSet[nodeIndex]->mItemId) {
       continue;
     }
 
     // If there are search terms, we are already getting only uri nodes,
     // thus we don't need to filter node types. Though, we must check for
     // matching terms.
@@ -3554,18 +3509,17 @@ nsNavHistory::RowToResult(mozIStorageVal
         // our options for it. However, if the parent type was tag query, we do not
         // apply them, because it would not yield any results.
         resultNode->GetAsContainer()->mOptions = aOptions;
       }
     }
 
     resultNode.forget(aResult);
     return rv;
-  } else if (aOptions->ResultType() == nsNavHistoryQueryOptions::RESULTS_AS_URI ||
-             aOptions->ResultType() == nsNavHistoryQueryOptions::RESULTS_AS_TAG_CONTENTS) {
+  } else if (aOptions->ResultType() == nsNavHistoryQueryOptions::RESULTS_AS_URI) {
     RefPtr<nsNavHistoryResultNode> resultNode =
       new nsNavHistoryResultNode(url, title, accessCount, time);
 
     if (itemId != -1) {
       resultNode->mItemId = itemId;
       resultNode->mFolderId = parentId;
       resultNode->mDateAdded = aRow->AsInt64(kGetInfoIndex_ItemDateAdded);
       resultNode->mLastModified = aRow->AsInt64(kGetInfoIndex_ItemLastModified);
@@ -3983,21 +3937,16 @@ GetSimpleBookmarksQueryFolder(const RefP
     return 0;
   if (!aQuery->SearchTerms().IsEmpty())
     return 0;
   if (aQuery->Tags().Length() > 0)
     return 0;
   if (aOptions->MaxResults() > 0)
     return 0;
 
-  // RESULTS_AS_TAG_CONTENTS is quite similar to a folder shortcut, but it must
-  // not be treated like that, since it needs all query options.
-  if (aOptions->ResultType() == nsINavHistoryQueryOptions::RESULTS_AS_TAG_CONTENTS)
-    return 0;
-
   // Don't care about onlyBookmarked flag, since specifying a bookmark
   // folder is inferring onlyBookmarked.
 
   return aQuery->Folders()[0];
 }
 
 
 // ParseSearchTermsFromQuery
--- a/toolkit/components/places/nsNavHistoryQuery.cpp
+++ b/toolkit/components/places/nsNavHistoryQuery.cpp
@@ -1289,19 +1289,20 @@ nsNavHistoryQueryOptions::GetResultType(
 }
 NS_IMETHODIMP
 nsNavHistoryQueryOptions::SetResultType(uint16_t aType)
 {
   if (aType > RESULTS_AS_LEFT_PANE_QUERY)
     return NS_ERROR_INVALID_ARG;
   // Tag queries, containers and the roots query are bookmarks related, so we
   // set the QueryType accordingly.
-  if (aType == RESULTS_AS_TAG_QUERY || aType == RESULTS_AS_TAG_CONTENTS ||
-      aType == RESULTS_AS_ROOTS_QUERY || aType == RESULTS_AS_LEFT_PANE_QUERY)
+  if (aType == RESULTS_AS_TAG_QUERY || aType == RESULTS_AS_ROOTS_QUERY ||
+      aType == RESULTS_AS_LEFT_PANE_QUERY) {
     mQueryType = QUERY_TYPE_BOOKMARKS;
+  }
   mResultType = aType;
   return NS_OK;
 }
 
 // excludeItems
 NS_IMETHODIMP
 nsNavHistoryQueryOptions::GetExcludeItems(bool* aExclude)
 {
@@ -1392,18 +1393,17 @@ nsNavHistoryQueryOptions::GetQueryType(u
   *_retval = mQueryType;
   return NS_OK;
 }
 NS_IMETHODIMP
 nsNavHistoryQueryOptions::SetQueryType(uint16_t aQueryType)
 {
   // Tag query and containers are forced to QUERY_TYPE_BOOKMARKS when the
   // resultType is set.
-  if (mResultType == RESULTS_AS_TAG_CONTENTS ||
-      mResultType == RESULTS_AS_TAG_QUERY ||
+  if (mResultType == RESULTS_AS_TAG_QUERY ||
       mResultType == RESULTS_AS_LEFT_PANE_QUERY ||
       mResultType == RESULTS_AS_ROOTS_QUERY)
    return NS_OK;
   mQueryType = aQueryType;
   return NS_OK;
 }
 
 // asyncEnabled
--- a/toolkit/components/places/nsNavHistoryResult.cpp
+++ b/toolkit/components/places/nsNavHistoryResult.cpp
@@ -2021,19 +2021,24 @@ nsNavHistoryQueryResultNode::GetHasChild
 
   if (!CanExpand()) {
     return NS_OK;
   }
 
   uint16_t resultType = mOptions->ResultType();
 
   // Tags are always populated, otherwise they are removed.
-  if (resultType == nsINavHistoryQueryOptions::RESULTS_AS_TAG_CONTENTS ||
-      // AllBookmarks also always has children.
-      resultType == nsINavHistoryQueryOptions::RESULTS_AS_ROOTS_QUERY ||
+  if (mQuery->Tags().Length() == 1 && mParent &&
+      mParent->mOptions->ResultType() == nsINavHistoryQueryOptions::RESULTS_AS_TAG_QUERY) {
+    *aHasChildren = true;
+    return NS_OK;
+  }
+
+  // AllBookmarks and the left pane folder also always have children.
+  if (resultType == nsINavHistoryQueryOptions::RESULTS_AS_ROOTS_QUERY ||
       resultType == nsINavHistoryQueryOptions::RESULTS_AS_LEFT_PANE_QUERY) {
     *aHasChildren = true;
     return NS_OK;
   }
 
   // For tag containers query we must check if we have any tag
   if (resultType == nsINavHistoryQueryOptions::RESULTS_AS_TAG_QUERY) {
     nsCOMPtr<nsITaggingService> tagging =
@@ -2585,18 +2590,17 @@ nsNavHistoryQueryResultNode::OnTitleChan
     NS_ENSURE_SUCCESS(rv, rv);
     return NS_OK;
   }
 
   // compute what the new title should be
   NS_ConvertUTF16toUTF8 newTitle(aPageTitle);
 
   bool onlyOneEntry =
-    mOptions->ResultType() == nsINavHistoryQueryOptions::RESULTS_AS_URI ||
-    mOptions->ResultType() == nsINavHistoryQueryOptions::RESULTS_AS_TAG_CONTENTS;
+    mOptions->ResultType() == nsINavHistoryQueryOptions::RESULTS_AS_URI;
 
   // See if our query has any search term matching.
   if (mHasSearchTerms) {
     // Find all matching URI nodes.
     nsCOMArray<nsNavHistoryResultNode> matches;
     nsAutoCString spec;
     nsresult rv = aURI->GetSpec(spec);
     NS_ENSURE_SUCCESS(rv, rv);
@@ -2680,20 +2684,19 @@ nsNavHistoryQueryResultNode::OnDeleteURI
     // complicated.  In this case it's possible one of the child queries has
     // no more children and it should be removed.  Unfortunately there is no
     // way to know that without executing the child query and counting results.
     nsresult rv = Refresh();
     NS_ENSURE_SUCCESS(rv, rv);
     return NS_OK;
   }
 
-  bool onlyOneEntry = (mOptions->ResultType() ==
-                         nsINavHistoryQueryOptions::RESULTS_AS_URI ||
-                       mOptions->ResultType() ==
-                         nsINavHistoryQueryOptions::RESULTS_AS_TAG_CONTENTS);
+  bool onlyOneEntry =
+    mOptions->ResultType() == nsINavHistoryQueryOptions::RESULTS_AS_URI;
+
   nsAutoCString spec;
   nsresult rv = aURI->GetSpec(spec);
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCOMArray<nsNavHistoryResultNode> matches;
   RecursiveFindURIs(onlyOneEntry, this, spec, &matches);
   for (int32_t i = 0; i < matches.Count(); ++i) {
     nsNavHistoryResultNode* node = matches[i];
@@ -2743,20 +2746,18 @@ nsNavHistoryQueryResultNode::OnPageChang
                                            const nsACString& aGUID)
 {
   nsAutoCString spec;
   nsresult rv = aURI->GetSpec(spec);
   NS_ENSURE_SUCCESS(rv, rv);
 
   switch (aChangedAttribute) {
     case nsINavHistoryObserver::ATTRIBUTE_FAVICON: {
-      bool onlyOneEntry = (mOptions->ResultType() ==
-                             nsINavHistoryQueryOptions::RESULTS_AS_URI ||
-                           mOptions->ResultType() ==
-                             nsINavHistoryQueryOptions::RESULTS_AS_TAG_CONTENTS);
+      bool onlyOneEntry =
+        mOptions->ResultType() == nsINavHistoryQueryOptions::RESULTS_AS_URI;
       UpdateURIs(true, onlyOneEntry, false, spec, setFaviconCallback,
                  nullptr);
       break;
     }
     default:
       NS_WARNING("Unknown page changed notification");
   }
   return NS_OK;
@@ -2795,21 +2796,18 @@ nsNavHistoryQueryResultNode::OnDeleteVis
 nsresult
 nsNavHistoryQueryResultNode::NotifyIfTagsChanged(nsIURI* aURI)
 {
   nsNavHistoryResult* result = GetResult();
   NS_ENSURE_STATE(result);
   nsAutoCString spec;
   nsresult rv = aURI->GetSpec(spec);
   NS_ENSURE_SUCCESS(rv, rv);
-  bool onlyOneEntry = (mOptions->ResultType() ==
-                         nsINavHistoryQueryOptions::RESULTS_AS_URI ||
-                       mOptions->ResultType() ==
-                         nsINavHistoryQueryOptions::RESULTS_AS_TAG_CONTENTS
-                         );
+  bool onlyOneEntry =
+    mOptions->ResultType() == nsINavHistoryQueryOptions::RESULTS_AS_URI;
 
   // Find matching URI nodes.
   RefPtr<nsNavHistoryResultNode> node;
   nsNavHistory* history = nsNavHistory::GetHistoryService();
 
   nsCOMArray<nsNavHistoryResultNode> matches;
   RecursiveFindURIs(onlyOneEntry, this, spec, &matches);
 
deleted file mode 100644
--- a/toolkit/components/places/tests/queries/test_results-as-tag-contents-query.js
+++ /dev/null
@@ -1,121 +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/. */
-
-var testData = [
-  { isInQuery: true,
-    isDetails: true,
-    title: "bmoz",
-    uri: "http://foo.com/",
-    isBookmark: true,
-    isTag: true,
-    tagArray: ["bugzilla"] },
-
-  { isInQuery: true,
-    isDetails: true,
-    title: "C Moz",
-    uri: "http://foo.com/changeme1.html",
-    isBookmark: true,
-    isTag: true,
-    tagArray: ["moz", "bugzilla"] },
-
-  { isInQuery: false,
-    isDetails: true,
-    title: "amo",
-    uri: "http://foo2.com/",
-    isBookmark: true,
-    isTag: true,
-    tagArray: ["moz"] },
-
-  { isInQuery: false,
-    isDetails: true,
-    title: "amo",
-    uri: "http://foo.com/changeme2.html",
-    isBookmark: true },
-];
-
-function getIdForTag(aTagName) {
-  var id = -1;
-  var query = PlacesUtils.history.getNewQuery();
-  query.setFolders([PlacesUtils.tagsFolderId], 1);
-  var options = PlacesUtils.history.getNewQueryOptions();
-  var root = PlacesUtils.history.executeQuery(query, options).root;
-  root.containerOpen = true;
-  var cc = root.childCount;
-  Assert.equal(root.childCount, 2);
-  for (let i = 0; i < cc; i++) {
-    let node = root.getChild(i);
-    if (node.title == aTagName) {
-      id = node.itemId;
-      break;
-    }
-  }
-  root.containerOpen = false;
-  return id;
-}
-
- /**
-  * This test will test Queries that use relative search terms and URI options
-  */
-add_task(async function test_results_as_tag_contents_query() {
-  await task_populateDB(testData);
-
-  // Get tag id.
-  let tagId = getIdForTag("bugzilla");
-  Assert.ok(tagId > 0);
-
-  var options = PlacesUtils.history.getNewQueryOptions();
-  options.resultType = options.RESULTS_AS_TAG_CONTENTS;
-  var query = PlacesUtils.history.getNewQuery();
-  query.setFolders([tagId], 1);
-
-  var root = PlacesUtils.history.executeQuery(query, options).root;
-  root.containerOpen = true;
-
-  displayResultSet(root);
-  // Cannot use compare array to results, since results ordering is hardcoded
-  // and depending on lastModified (that could have VM timers issues).
-  testData.forEach(function(aEntry) {
-    if (aEntry.isInResult)
-      Assert.ok(isInResult({uri: "http://foo.com/added.html"}, root));
-  });
-
-  // If that passes, check liveupdate
-  // Add to the query set
-  var change1 = { isVisit: true,
-                  isDetails: true,
-                  uri: "http://foo.com/added.html",
-                  title: "mozadded",
-                  isBookmark: true,
-                  isTag: true,
-                  tagArray: ["moz", "bugzilla"] };
-  info("Adding item to query");
-  await task_populateDB([change1]);
-  info("These results should have been LIVE UPDATED with the new addition");
-  displayResultSet(root);
-  Assert.ok(isInResult(change1, root));
-
-  // Add one by adding a tag, remove one by removing search term.
-  info("Updating items");
-  var change2 = [{ isDetails: true,
-                   uri: "http://foo3.com/",
-                   title: "foo"},
-                 { isDetails: true,
-                   uri: "http://foo.com/changeme2.html",
-                   title: "zydeco",
-                   isBookmark: true,
-                   isTag: true,
-                   tagArray: ["bugzilla", "moz"] }];
-  await task_populateDB(change2);
-  Assert.ok(!isInResult({uri: "http://fooz.com/"}, root));
-  Assert.ok(isInResult({uri: "http://foo.com/changeme2.html"}, root));
-
-  // Test removing a tag updates us.
-  info("Deleting item");
-  PlacesUtils.tagging.untagURI(uri("http://foo.com/changeme2.html"), ["bugzilla"]);
-  Assert.ok(!isInResult({uri: "http://foo.com/changeme2.html"}, root));
-
-  root.containerOpen = false;
-});
--- a/toolkit/components/places/tests/queries/xpcshell.ini
+++ b/toolkit/components/places/tests/queries/xpcshell.ini
@@ -14,17 +14,16 @@ skip-if = toolkit == 'android'
 [test_onlyBookmarked.js]
 [test_options_inherit.js]
 [test_query_uri_liveupdate.js]
 [test_queryMultipleFolder.js]
 [test_querySerialization.js]
 [test_redirects.js]
 [test_results-as-left-pane.js]
 [test_results-as-roots.js]
-[test_results-as-tag-contents-query.js]
 [test_results-as-tag-query.js]
 [test_results-as-visit.js]
 [test_search_tags.js]
 [test_searchterms-domain.js]
 [test_searchterms-uri.js]
 [test_searchterms-bookmarklets.js]
 [test_sort-date-site-grouping.js]
 [test_sorting.js]
--- a/toolkit/components/places/tests/unit/test_resolveNullBookmarkTitles.js
+++ b/toolkit/components/places/tests/unit/test_resolveNullBookmarkTitles.js
@@ -22,34 +22,16 @@ add_task(async function() {
     url: uri2,
     title: null
   });
 
   PlacesUtils.tagging.tagURI(uri1, ["tag 1"]);
   PlacesUtils.tagging.tagURI(uri2, ["tag 2"]);
 });
 
-add_task(async function testAsTagQuery() {
-  let options = PlacesUtils.history.getNewQueryOptions();
-  options.queryType = Ci.nsINavHistoryQueryOptions.QUERY_TYPE_BOOKMARKS;
-  options.resultType = options.RESULTS_AS_TAG_CONTENTS;
-
-  let query = PlacesUtils.history.getNewQuery();
-  // if we don't set a tag folder, RESULTS_AS_TAG_CONTENTS will return all
-  // tagged URIs
-  let root = PlacesUtils.history.executeQuery(query, options).root;
-  root.containerOpen = true;
-  Assert.equal(root.childCount, 2);
-  // actually RESULTS_AS_TAG_CONTENTS return results ordered by place_id DESC
-  // so they are reversed
-  Assert.equal(root.getChild(0).title, "");
-  Assert.equal(root.getChild(1).title, "");
-  root.containerOpen = false;
-});
-
 add_task(async function testTagQuery() {
   let options = PlacesUtils.history.getNewQueryOptions();
   let query = PlacesUtils.history.getNewQuery();
   query.tags = ["tag 1"];
   let root = PlacesUtils.history.executeQuery(query, options).root;
   root.containerOpen = true;
   Assert.equal(root.childCount, 1);
   Assert.equal(root.getChild(0).title, "");