Merge mozilla-central to mozilla-inbound
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Mon, 11 Apr 2016 11:47:32 +0200
changeset 330467 f50bbe259eb0971d77f68d77fb93dd6d5b49ac1a
parent 330466 efd6926125e25711dcd2dc7d390564652ac86b74 (current diff)
parent 330429 e847cfcb315f511f4928b03fd47dcf57aad05e1e (diff)
child 330468 d300e4102b65ff28fc89bd77b731bcd82232d66d
push id6048
push userkmoir@mozilla.com
push dateMon, 06 Jun 2016 19:02:08 +0000
treeherdermozilla-beta@46d72a56c57d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone48.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
Merge mozilla-central to mozilla-inbound
--- a/browser/components/syncedtabs/TabListView.js
+++ b/browser/components/syncedtabs/TabListView.js
@@ -237,18 +237,20 @@ TabListView.prototype = {
     }
     if (item.focused) {
       itemNode.focus();
     }
     itemNode.dataset.url = item.url;
 
     itemNode.querySelector(".item-title").textContent = item.title;
 
-    let icon = itemNode.querySelector(".item-icon-container");
-    icon.style.backgroundImage = "url(" + item.icon + ")";
+    if (item.icon) {
+      let icon = itemNode.querySelector(".item-icon-container");
+      icon.style.backgroundImage = "url(" + item.icon + ")";
+    }
   },
 
   onClick(event) {
     let itemNode = this._findParentItemNode(event.target);
     if (!itemNode) {
       return;
     }
 
--- a/browser/themes/shared/syncedtabs/sidebar.inc.css
+++ b/browser/themes/shared/syncedtabs/sidebar.inc.css
@@ -79,20 +79,31 @@ body {
 .item.selected:focus > .item-title-container {
   background-color: Highlight;
   color: HighlightText;
 }
 
 .client .item.tab > .item-title-container {
   padding-inline-start: 35px;
 }
+
 .item.tab > .item-title-container {
   padding-inline-start: 20px;
 }
 
+.item.tab > .item-title-container > .item-icon-container {
+  background-image: url("chrome://mozapps/skin/places/defaultFavicon.png");
+}
+
+@media (min-resolution: 1.1dppx) {
+.item.tab > .item-title-container > .item-icon-container {
+    background-image: url("chrome://mozapps/skin/places/defaultFavicon@2x.png");
+  }
+}
+
 .item-icon-container {
   min-width: 16px;
   max-width: 16px;
   min-height: 16px;
   max-height: 16px;
   margin-right: 5px;
   margin-left: 5px;
   background-size: 16px 16px;
--- a/services/sync/modules/SyncedTabs.jsm
+++ b/services/sync/modules/SyncedTabs.jsm
@@ -68,17 +68,17 @@ let SyncedTabsInternal = {
       icon = tab.icon;
     }
     if (!icon) {
       try {
         icon = (yield PlacesUtils.promiseFaviconLinkUrl(url)).spec;
       } catch (ex) { /* no favicon avaiable */ }
     }
     if (!icon) {
-      icon = PlacesUtils.favicons.defaultFavicon.spec;
+      icon = "";
     }
     return {
       type:  "tab",
       title: tab.title || url,
       url,
       icon,
       client: client.id,
       lastUsed: tab.lastUsed,
--- a/services/sync/tests/unit/test_syncedtabs.js
+++ b/services/sync/tests/unit/test_syncedtabs.js
@@ -152,18 +152,18 @@ add_task(function* test_clientWithTabsIc
     },
   });
 
   let clients = yield SyncedTabs.getTabClients();
   equal(clients.length, 1);
   clients.sort((a, b) => { return a.name.localeCompare(b.name);});
   equal(clients[0].tabs.length, 1);
   equal(clients[0].tabs[0].url, "http://foo.com/");
-  // expect the default favicon due to the pref being false.
-  equal(clients[0].tabs[0].icon, faviconService.defaultFavicon.spec);
+  // expect the default favicon (empty string) due to the pref being false.
+  equal(clients[0].tabs[0].icon, "");
   Services.prefs.clearUserPref("services.sync.syncedTabs.showRemoteIcons");
 });
 
 add_task(function* test_filter() {
   // Nothing matches.
   yield configureClients({
     guid_desktop: {
       clientName: "My Desktop",
--- a/toolkit/mozapps/extensions/content/extensions.js
+++ b/toolkit/mozapps/extensions/content/extensions.js
@@ -2250,17 +2250,17 @@ var gDiscoverView = {
     aRequest.cancel(Components.results.NS_BINDING_ABORTED);
   },
 
   onStateChange: function(aWebProgress, aRequest, aStateFlags, aStatus) {
     let transferStart = Ci.nsIWebProgressListener.STATE_IS_DOCUMENT |
                         Ci.nsIWebProgressListener.STATE_IS_REQUEST |
                         Ci.nsIWebProgressListener.STATE_TRANSFERRING;
     // Once transferring begins show the content
-    if (aStateFlags & transferStart)
+    if ((aStateFlags & transferStart) === transferStart)
       this.node.selectedPanel = this._browser;
 
     // Only care about the network events
     if (!(aStateFlags & (Ci.nsIWebProgressListener.STATE_IS_NETWORK)))
       return;
 
     // If this is the start of network activity then show the loading page
     if (aStateFlags & (Ci.nsIWebProgressListener.STATE_START))
--- a/toolkit/mozapps/extensions/test/browser/browser_discovery.js
+++ b/toolkit/mozapps/extensions/test/browser/browser_discovery.js
@@ -630,8 +630,22 @@ add_test(function() {
   open_manager(null, function(aWindow) {
     gManagerWindow = aWindow;
     gCategoryUtilities = new CategoryUtilities(gManagerWindow);
     is(gCategoryUtilities.selectedCategory, "extension", "Should be showing the extension view");
     close_manager(gManagerWindow, run_next_test);
     Services.prefs.clearUserPref(PREF_DISCOVER_ENABLED);
   });
 });
+
+// Test for Bug 1219495 - should show placeholder content when offline
+add_test(function() {
+  // set a URL to cause an error
+  Services.prefs.setCharPref(PREF_DISCOVERURL, "https://nocert.example.com/");
+
+  open_manager("addons://discover/", function(aWindow) {
+    gManagerWindow = aWindow;
+
+    ok(isError(), "Should have shown the placeholder content");
+
+    close_manager(gManagerWindow, run_next_test);
+  });
+});