Backed out changeset d103f117bb84 (bug 1480888) for xpcshell failures on /extensions/test/xpcshell/test_ext_topSites.js.
authorBrindusan Cristian <cbrindusan@mozilla.com>
Fri, 10 Aug 2018 08:36:36 +0300
changeset 485964 64e80e767f816f6cf43f906b40b603a245fe2110
parent 485963 29b6e333a0ed5322c4387e412d54c8437fae013b
child 486037 d999fb858fb2c007c5be4af72bce419c63c69b8e
child 486038 925d2fd06a2451ceee7c9136fe6f337a87c2af67
push id9719
push userffxbld-merge
push dateFri, 24 Aug 2018 17:49:46 +0000
treeherdermozilla-beta@719ec98fba77 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1480888
milestone63.0a1
backs outd103f117bb840de854c518fc4c0b4388f49dfc6e
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 d103f117bb84 (bug 1480888) for xpcshell failures on /extensions/test/xpcshell/test_ext_topSites.js.
toolkit/modules/NewTabUtils.jsm
toolkit/modules/tests/xpcshell/head.js
toolkit/modules/tests/xpcshell/test_NewTabUtils.js
toolkit/modules/tests/xpcshell/xpcshell.ini
--- a/toolkit/modules/NewTabUtils.jsm
+++ b/toolkit/modules/NewTabUtils.jsm
@@ -5,22 +5,16 @@
 "use strict";
 
 var EXPORTED_SYMBOLS = ["NewTabUtils"];
 
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.importGlobalProperties(["btoa", "URL"]);
 
-const {shortURL} = ChromeUtils.import("resource://activity-stream/lib/ShortURL.jsm", {});
-const {
-    SEARCH_SHORTCUTS_EXPERIMENT,
-    getSearchProvider
-} = ChromeUtils.import("resource://activity-stream/lib/SearchShortcuts.jsm", {});
-
 ChromeUtils.defineModuleGetter(this, "PlacesUtils",
   "resource://gre/modules/PlacesUtils.jsm");
 
 ChromeUtils.defineModuleGetter(this, "PageThumbs",
   "resource://gre/modules/PageThumbs.jsm");
 
 ChromeUtils.defineModuleGetter(this, "BinarySearch",
   "resource://gre/modules/BinarySearch.jsm");
@@ -1171,26 +1165,16 @@ var ActivityStreamProvider = {
         if (isOtherBetter(link, other)) {
           link = other;
         }
         combiner(link, other);
       }
       map.set(host, link);
     }
 
-    // Convert all links that are supposed to be a seach shortcut to its canonical URL
-    if (Services.prefs.getBoolPref(`browser.newtabpage.activity-stream.${SEARCH_SHORTCUTS_EXPERIMENT}`)) {
-      links.forEach(link => {
-        let searchProvider = getSearchProvider(shortURL(link));
-        if (searchProvider) {
-          link.url = searchProvider.url;
-        }
-      });
-    }
-
     // Remove any blocked links.
     if (!options.ignoreBlocked) {
       links = links.filter(link => !BlockedLinks.isBlocked(link));
     }
 
     if (options.onePerDomain) {
       // De-dup the links.
       const exactHosts = new Map();
--- a/toolkit/modules/tests/xpcshell/head.js
+++ b/toolkit/modules/tests/xpcshell/head.js
@@ -5,24 +5,22 @@ Cu.importGlobalProperties(["btoa"]);
 
 ChromeUtils.defineModuleGetter(this, "PlacesTestUtils",
   "resource://testing-common/PlacesTestUtils.jsm");
 
 ChromeUtils.defineModuleGetter(this, "PlacesUtils",
   "resource://gre/modules/PlacesUtils.jsm");
 
 const PREF_NEWTAB_ENHANCED = "browser.newtabpage.enhanced";
-const SEARCH_SHORTCUTS_EXPERIMENT_PREF = "browser.newtabpage.activity-stream.improvesearch.topSiteSearchShortcuts";
 
 // use time at the start of the tests, chnaging it inside timeDaysAgo()
 // may cause tiny time differences, which break expected sql ordering
 const TIME_NOW = (new Date()).getTime();
 
 Services.prefs.setBoolPref(PREF_NEWTAB_ENHANCED, true);
-Services.prefs.setBoolPref(SEARCH_SHORTCUTS_EXPERIMENT_PREF, false);
 
 do_get_profile();
 
 // utility function to compute past timestamp in microseconds
 function timeDaysAgo(numDays) {
   return (TIME_NOW - (numDays * 24 * 60 * 60 * 1000)) * 1000;
 }
 
--- a/toolkit/modules/tests/xpcshell/test_NewTabUtils.js
+++ b/toolkit/modules/tests/xpcshell/test_NewTabUtils.js
@@ -674,32 +674,16 @@ add_task(async function getTopFrecentSit
   links = await provider.getTopSites();
   Assert.equal(links.length, 0, "adding a single visit doesn't exceed default threshold");
 
   links = await provider.getTopSites({topsiteFrecency: 100});
   Assert.equal(links.length, 1, "adding a visit yields a link");
   Assert.equal(links[0].url, testURI, "added visit corresponds to added url");
 });
 
-add_task(async function getTopFrecentSites_improveSearch() {
-  await setUpActivityStreamTest();
-  const SEARCH_SHORTCUTS_EXPERIMENT_PREF = "browser.newtabpage.activity-stream.improvesearch.topSiteSearchShortcuts";
-  Services.prefs.setBoolPref(SEARCH_SHORTCUTS_EXPERIMENT_PREF, true);
-
-  let testURI = "https://www.amazon.com?search=tv";
-  await PlacesTestUtils.addVisits(testURI);
-
-  let provider = NewTabUtils.activityStreamLinks;
-  let links = await provider.getTopSites({topsiteFrecency: 100});
-  Assert.equal(links.length, 1, "sanity check that we got the link from top sites");
-  Assert.equal(links[0].url, "https://amazon.com", "the amazon site was converted to generic search shortcut site");
-
-  Services.prefs.setBoolPref(SEARCH_SHORTCUTS_EXPERIMENT_PREF, false);
-});
-
 add_task(async function getTopFrecentSites_no_dedup() {
   await setUpActivityStreamTest();
 
   let provider = NewTabUtils.activityStreamLinks;
   let links = await provider.getTopSites({topsiteFrecency: 100});
   Assert.equal(links.length, 0, "empty history yields empty links");
 
   // Add a visits in reverse order they will be returned in when not deduped.
--- a/toolkit/modules/tests/xpcshell/xpcshell.ini
+++ b/toolkit/modules/tests/xpcshell/xpcshell.ini
@@ -1,11 +1,10 @@
 [DEFAULT]
 head = head.js
-firefox-appdir = browser
 support-files =
   propertyLists/bug710259_propertyListBinary.plist
   propertyLists/bug710259_propertyListXML.plist
   chromeappsstore.sqlite
   corrupt.sqlite
   zips/zen.zip
 
 [test_BinarySearch.js]