Backed out changeset 2227c747a95b (bug 1520833) for failing browser/components/urlbar/tests/unit/test_providerUnifiedComplete.js on a CLOSED TREE
authorOana Pop Rus <opoprus@mozilla.com>
Sat, 19 Jan 2019 02:29:06 +0200
changeset 454494 57dc8bbbc38f79ce532feb8947b40311e96ea577
parent 454493 f51c5057cc00e733f72ad2b97075d9621ea31552
child 454495 a71f2830d57099dc5e83af1cfbcf98c97c68f2f7
child 454496 edc9fc80bf25f7bfa6896db4274dfedf4e4bcc76
push id35397
push useropoprus@mozilla.com
push dateSat, 19 Jan 2019 03:35:41 +0000
treeherdermozilla-central@57dc8bbbc38f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1520833
milestone66.0a1
backs out2227c747a95b2e907460217a3c0860f54cf36243
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 2227c747a95b (bug 1520833) for failing browser/components/urlbar/tests/unit/test_providerUnifiedComplete.js on a CLOSED TREE
browser/components/urlbar/UrlbarProviderUnifiedComplete.jsm
browser/components/urlbar/tests/unit/test_providerUnifiedComplete.js
--- a/browser/components/urlbar/UrlbarProviderUnifiedComplete.jsm
+++ b/browser/components/urlbar/UrlbarProviderUnifiedComplete.jsm
@@ -300,23 +300,21 @@ function makeUrlbarMatch(tokens, info) {
       ...UrlbarMatch.payloadAndSimpleHighlights(tokens, {
         engine: [info.comment, true],
         icon: [info.icon, false],
       })
     );
   }
 
   // This is a normal url/title tuple.
-  let source;
-  let tags = [];
-  let comment = info.comment;
+  let source, tags, comment;
   let hasTags = info.style.includes("tag");
   if (info.style.includes("bookmark") || hasTags) {
     source = UrlbarUtils.MATCH_SOURCE.BOOKMARKS;
-    if (hasTags) {
+    if (info.style.includes("tag")) {
       // Split title and tags.
       [comment, tags] = info.comment.split(TITLE_TAGS_SEPARATOR);
       tags = tags.split(",").map(t => t.trim());
     }
   } else if (info.style.includes("preloaded-top-sites")) {
     source = UrlbarUtils.MATCH_SOURCE.OTHER_LOCAL;
   } else {
     source = UrlbarUtils.MATCH_SOURCE.HISTORY;
--- a/browser/components/urlbar/tests/unit/test_providerUnifiedComplete.js
+++ b/browser/components/urlbar/tests/unit/test_providerUnifiedComplete.js
@@ -27,42 +27,28 @@ add_task(async function test_unifiedComp
       location: {
         href: AppConstants.BROWSER_CHROME_URL,
       },
     },
   });
   let context = createContext("moz", {isPrivate: false});
 
   // Add entries from multiple sources.
+  await PlacesTestUtils.addVisits("https://history.mozilla.org/");
   await PlacesUtils.bookmarks.insert({
     url: "https://bookmark.mozilla.org/",
-    title: "Test bookmark",
     parentGuid: PlacesUtils.bookmarks.unfiledGuid,
   });
-  await PlacesTestUtils.addVisits([
-    {uri: "https://history.mozilla.org/", title: "Test history"},
-    {uri: "https://tab.mozilla.org/", title: "Test tab"},
-  ]);
+  await PlacesTestUtils.addVisits("https://tab.mozilla.org/");
   UrlbarProviderOpenTabs.registerOpenTab("https://tab.mozilla.org/", 0);
 
   await controller.startQuery(context);
-
-  info("Results:\n" + context.results.map(m => `${m.title} - ${m.payload.url}`).join("\n"));
-  Assert.equal(context.results.length, 6, "Found the expected number of matches");
-
+  dump(context.results.map(m => m.title + " " + m.payload.url) + "\n");
   Assert.deepEqual([
     UrlbarUtils.MATCH_TYPE.SEARCH,
     UrlbarUtils.MATCH_TYPE.SEARCH,
     UrlbarUtils.MATCH_TYPE.SEARCH,
     UrlbarUtils.MATCH_TYPE.URL,
     UrlbarUtils.MATCH_TYPE.TAB_SWITCH,
     UrlbarUtils.MATCH_TYPE.URL,
-  ], context.results.map(m => m.type), "Check match types");
-
-  Assert.deepEqual([
-    "engine-suggestions.xml",
-    "engine-suggestions.xml",
-    "engine-suggestions.xml",
-    "Test bookmark",
-    "Test tab",
-    "Test history",
-  ], context.results.map(m => m.title), "Check match titles");
+  ], context.results.map(m => m.type), "Check matches");
+  Assert.equal(context.results.length, 6, "Found the expected number of matches");
 });