Backing out changeset 0c45b1fc2f7c from bug 601143 due to test failures on debug builds. a=backout
authorDave Townsend <dtownsend@oxymoronical.com>
Wed, 15 Dec 2010 16:55:48 -0800
changeset 59289 9aa42cdd6ab4d70f5d76c163c3ed621d77aa53b0
parent 59288 a2b4d0911bb01aea2b25d19ee372b6f38972b7bb
child 59290 9254211b7633a67ccbe9c0a834c4cfe45769b48b
push id1
push usershaver@mozilla.com
push dateTue, 04 Jan 2011 17:58:04 +0000
reviewersbackout
bugs601143
milestone2.0b9pre
Backing out changeset 0c45b1fc2f7c from bug 601143 due to test failures on debug builds. a=backout
toolkit/mozapps/extensions/content/extensions.js
toolkit/mozapps/extensions/content/extensions.xul
toolkit/mozapps/extensions/test/browser/Makefile.in
toolkit/mozapps/extensions/test/browser/browser_discovery.js
toolkit/mozapps/extensions/test/browser/discovery.html
toolkit/mozapps/extensions/test/browser/head.js
toolkit/themes/gnomestripe/mozapps/extensions/discover-logo.png
toolkit/themes/gnomestripe/mozapps/extensions/extensions.css
toolkit/themes/gnomestripe/mozapps/jar.mn
toolkit/themes/pinstripe/mozapps/extensions/discover-logo.png
toolkit/themes/pinstripe/mozapps/extensions/extensions.css
toolkit/themes/pinstripe/mozapps/jar.mn
toolkit/themes/winstripe/mozapps/extensions/discover-logo.png
toolkit/themes/winstripe/mozapps/extensions/extensions.css
toolkit/themes/winstripe/mozapps/jar.mn
--- a/toolkit/mozapps/extensions/content/extensions.js
+++ b/toolkit/mozapps/extensions/content/extensions.js
@@ -1479,60 +1479,35 @@ var gHeader = {
 
 var gDiscoverView = {
   node: null,
   enabled: true,
   // Set to true after the view is first shown. If initialization completes
   // after this then it must also load the discover homepage
   loaded: false,
   _browser: null,
-  _loading: null,
-  _error: null,
-  homepageURL: null,
-  _loadListeners: [],
 
   initialize: function() {
     if (Services.prefs.getPrefType(PREF_DISCOVERURL) == Services.prefs.PREF_INVALID) {
       this.enabled = false;
       gCategories.get("addons://discover/").hidden = true;
       return;
     }
 
     this.node = document.getElementById("discover-view");
-    this._loading = document.getElementById("discover-loading");
-    this._error = document.getElementById("discover-error");
     this._browser = document.getElementById("discover-browser");
 
     var url = Cc["@mozilla.org/toolkit/URLFormatterService;1"]
                 .getService(Ci.nsIURLFormatter)
                 .formatURLPref(PREF_DISCOVERURL);
 
-    var self = this;
-
-    function setURL(aURL) {
-      try {
-        self.homepageURL = Services.io.newURI(aURL, null, null);
-      } catch (e) {
-        self.showError();
-        notifyInitialized();
-        return;
-      }
-
-      self._browser.homePage = self.homepageURL.spec;
-      self._browser.addProgressListener(self, Ci.nsIWebProgress.NOTIFY_ALL |
-                                              Ci.nsIWebProgress.NOTIFY_STATE_ALL);
-
-      if (self.loaded)
-        self._loadBrowser(notifyInitialized);
-      else
-        notifyInitialized();
-    }
+    var browser = gDiscoverView._browser;
 
     if (Services.prefs.getBoolPref(PREF_BACKGROUND_UPDATE) == false) {
-      setURL(url);
+      browser.homePage = url;
       return;
     }
 
     gPendingInitializations++;
     AddonManager.getAllAddons(function(aAddons) {
       var list = {};
       aAddons.forEach(function(aAddon) {
         list[aAddon.id] = {
@@ -1540,132 +1515,49 @@ var gDiscoverView = {
           version: aAddon.version,
           type: aAddon.type,
           userDisabled: aAddon.userDisabled,
           isCompatible: aAddon.isCompatible,
           isBlocklisted: aAddon.blocklistState == Ci.nsIBlocklistService.STATE_BLOCKED
         }
       });
 
-      setURL(url + "#" + JSON.stringify(list));
+      browser.homePage = url + "#" + JSON.stringify(list);
+
+      if (gDiscoverView.loaded) {
+        browser.addEventListener("load", function() {
+          browser.removeEventListener("load", arguments.callee, true);
+          notifyInitialized();
+        }, true);
+        browser.goHome();
+      } else {
+        notifyInitialized();
+      }
     });
   },
 
   show: function() {
-    // If the view has loaded before and the error page is not visible then
-    // there is nothing else to do
-    if (this.loaded && this.node.selectedPanel != this._error) {
+    if (!this.loaded) {
+      this.loaded = true;
+
+      var browser = gDiscoverView._browser;
+      browser.addEventListener("load", function() {
+        browser.removeEventListener("load", arguments.callee, true);
+        gViewController.updateCommands();
+        gViewController.notifyViewChanged();
+      }, true);
+      browser.goHome();
+    } else {
       gViewController.updateCommands();
       gViewController.notifyViewChanged();
-      return;
     }
-
-    this.loaded = true;
-
-    // No homepage means initialization isn't complete, the browser will get
-    // loaded once initialization is complete
-    if (!this.homepageURL) {
-      this._loadListeners.push(gViewController.notifyViewChanged.bind(gViewController));
-      return;
-    }
-
-    this._loadBrowser(gViewController.notifyViewChanged.bind(gViewController));
   },
 
   hide: function() { },
 
-  showError: function() {
-    this.node.selectedPanel = this._error;
-  },
-
-  _loadBrowser: function(aCallback) {
-    this.node.selectedPanel = this._loading;
-
-    if (aCallback)
-      this._loadListeners.push(aCallback);
-
-    if (this._browser.currentURI.equals(this.homepageURL))
-      this._browser.reload();
-    else
-      this._browser.goHome();
-  },
-
-  onLocationChange: function(aWebProgress, aRequest, aLocation) {
-    // Ignore the about:blank load
-    if (aLocation.spec == "about:blank")
-      return;
-
-    // If the hostname is the same as the new location's host and either the
-    // default scheme is insecure or the new location is secure then continue
-    // with the load
-    if (aLocation.host == this.homepageURL.host &&
-        (!this.homepageURL.schemeIs("https") || aLocation.schemeIs("https")))
-      return;
-
-    // Canceling the request will send an error to onStateChange which will show
-    // the error page
-    aRequest.cancel(Components.results.NS_BINDING_ABORTED);
-  },
-
-  onSecurityChange: function(aWebProgress, aRequest, aState) {
-    // Don't care about security if the page is not https
-    if (!this.homepageURL.schemeIs("https"))
-      return;
-
-    // If the request was secure then it is ok
-    if (aState & Ci.nsIWebProgressListener.STATE_IS_SECURE)
-      return;
-
-    // Canceling the request will send an error to onStateChange which will show
-    // the error page
-    aRequest.cancel(Components.results.NS_BINDING_ABORTED);
-  },
-
-  onStateChange: function(aWebProgress, aRequest, aStateFlags, aStatus) {
-    // Only care about the network stop status events
-    if (!(aStateFlags & (Ci.nsIWebProgressListener.STATE_IS_NETWORK)) ||
-        !(aStateFlags & (Ci.nsIWebProgressListener.STATE_STOP)))
-      return;
-
-    // Sometimes we stop getting onLocationChange events so we must redo the
-    // url tests here (bug 602256)
-    var location = this._browser.currentURI;
-
-    // Consider the successful load of about:blank as still loading
-    if (Components.isSuccessCode(aStatus) && location && location.spec == "about:blank")
-      return;
-
-    // If there was an error loading the page or the new hostname is not the
-    // same as the default hostname or the default scheme is secure and the new
-    // scheme is insecure then show the error page
-    if (!Components.isSuccessCode(aStatus) ||
-        (aRequest && aRequest instanceof Ci.nsIHttpChannel && !aRequest.requestSucceeded) ||
-        location.host != this.homepageURL.host ||
-        (this.homepageURL.schemeIs("https") && !location.schemeIs("https"))) {
-      this.showError();
-    } else {
-      // Got a successful load, make sure the browser is visible
-      this.node.selectedPanel = this._browser;
-      gViewController.updateCommands();
-    }
-
-    var listeners = this._loadListeners;
-    this._loadListeners = [];
-
-    listeners.forEach(function(aListener) {
-      aListener();
-    });
-  },
-
-  onProgressChange: function() { },
-  onStatusChange: function() { },
-
-  QueryInterface: XPCOMUtils.generateQI([Ci.nsIWebProgressListener,
-                                         Ci.nsISupportsWeakReference]),
-
   getSelectedAddon: function() null
 };
 
 
 var gCachedAddons = {};
 
 var gSearchView = {
   node: null,
--- a/toolkit/mozapps/extensions/content/extensions.xul
+++ b/toolkit/mozapps/extensions/content/extensions.xul
@@ -37,18 +37,16 @@
    -
    - ***** END LICENSE BLOCK ***** -->
 
 <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
 <?xml-stylesheet href="chrome://mozapps/content/extensions/extensions.css"?>
 <?xml-stylesheet href="chrome://mozapps/skin/extensions/extensions.css"?>
 
 <!DOCTYPE page [
-<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd" >
-%brandDTD;
 <!ENTITY % extensionsDTD SYSTEM "chrome://mozapps/locale/extensions/extensions.dtd">
 %extensionsDTD;
 ]>
 
 <page xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
       xmlns:xhtml="http://www.w3.org/1999/xhtml"
       id="addons-page" title="&addons.windowTitle;" disablechrome="true"
       role="application" windowtype="Addons:Manager"
@@ -249,44 +247,20 @@
     </richlistbox>
 
     <box id="view-port-container" flex="1">
 
       <!-- view port -->
       <deck id="view-port" flex="1">
 
         <!-- discover view -->
-        <deck id="discover-view" flex="1" class="view-pane">
-          <vbox id="discover-loading" align="center" pack="stretch" flex="1" class="alert-container">
-            <spacer class="alert-spacer-before"/>
-            <hbox class="alert loading" align="center">
-              <image/>
-              <label value="&loading.label;"/>
-            </hbox>
-            <spacer class="alert-spacer-after"/>
-          </vbox>
-          <vbox id="discover-error" align="center" pack="stretch" flex="1" class="alert-container">
-            <spacer class="alert-spacer-before"/>
-            <hbox>
-              <spacer class="discover-spacer-before"/>
-              <hbox class="alert" align="center">
-                <image class="discover-logo"/>
-                <vbox flex="1" align="stretch">
-                  <label class="discover-title">&discover.title;</label>
-                  <description class="discover-description">&discover.description2;</description>
-                  <description class="discover-footer">&discover.footer;</description>
-                </vbox>
-              </hbox>
-              <spacer class="discover-spacer-after"/>
-            </hbox>
-            <spacer class="alert-spacer-after"/>
-          </vbox>
+        <vbox id="discover-view" flex="1" class="view-pane">
           <browser id="discover-browser" type="content" flex="1"
                    disablehistory="true" homepage="about:blank"/>
-        </deck>
+        </vbox>
 
         <!-- search view -->
         <vbox id="search-view" flex="1" class="view-pane">
           <hbox class="view-header global-warning-container" align="center">
             <!-- global warnings -->
             <hbox class="global-warning" flex="1">
               <hbox class="global-warning-safemode" flex="1" align="center"
                     tooltiptext="&warning.safemode.label;">
--- a/toolkit/mozapps/extensions/test/browser/Makefile.in
+++ b/toolkit/mozapps/extensions/test/browser/Makefile.in
@@ -93,17 +93,16 @@ include $(DEPTH)/config/autoconf.mk
   browser_bug591465.xml \
   browser_searching.xml \
   browser_searching_empty.xml \
   browser_updatessl.rdf \
   browser_install.rdf \
   browser_install.xml \
   browser_install1_3.xpi \
   browser_eula.xml \
-  discovery.html \
   redirect.sjs \
   releaseNotes.xhtml \
   $(NULL)
 
 # Disabled browser_bug586574.js due to bug 596174
 
 include $(topsrcdir)/config/rules.mk
 
--- a/toolkit/mozapps/extensions/test/browser/browser_discovery.js
+++ b/toolkit/mozapps/extensions/test/browser/browser_discovery.js
@@ -1,47 +1,23 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 // Tests that the discovery view loads properly
 
 const PREF_BACKGROUND_UPDATE = "extensions.update.enabled";
-const MAIN_URL = "https://example.com/" + RELATIVE_DIR + "discovery.html";
 
 var gManagerWindow;
 var gCategoryUtilities;
 var gProvider;
 
-var gLoadCompleteCallback = null;
-
-var gProgressListener = {
-  onStateChange: function(aWebProgress, aRequest, aStateFlags, aStatus) {
-    // Only care about the network stop status events
-    if (!(aStateFlags & (Ci.nsIWebProgressListener.STATE_IS_NETWORK)) ||
-        !(aStateFlags & (Ci.nsIWebProgressListener.STATE_STOP)))
-      return;
-
-    if (gLoadCompleteCallback)
-      executeSoon(gLoadCompleteCallback);
-    gLoadCompleteCallback = null;
-  },
-
-  onLocationChange: function() { },
-  onSecurityChange: function() { },
-  onProgressChange: function() { },
-  onStatusChange: function() { },
-
-  QueryInterface: XPCOMUtils.generateQI([Ci.nsIWebProgressListener,
-                                         Ci.nsISupportsWeakReference]),
-};
-
 function test() {
   // Switch to a known url
-  Services.prefs.setCharPref(PREF_DISCOVERURL, MAIN_URL);
+  Services.prefs.setCharPref(PREF_DISCOVERURL, TESTROOT + "releaseNotes.xhtml");
 
   waitForExplicitFinish();
 
   gProvider = new MockProvider();
 
   gProvider.createAddons([{
     id: "addon1@tests.mozilla.org",
     name: "Test add-on 1",
@@ -71,32 +47,24 @@ function test() {
   run_next_test();
 }
 
 function end_test() {
   finish();
 }
 
 function getURL(aBrowser) {
-  if (gManagerWindow.document.getElementById("discover-view").selectedPanel !=
-      aBrowser)
-    return null;
-
   var url = aBrowser.currentURI.spec;
   var pos = url.indexOf("#");
   if (pos != -1)
     return url.substring(0, pos);
   return url;
 }
 
 function getHash(aBrowser) {
-  if (gManagerWindow.document.getElementById("discover-view").selectedPanel !=
-      aBrowser)
-    return null;
-
   var url = aBrowser.currentURI.spec;
   var pos = url.indexOf("#");
   if (pos != -1)
     return decodeURIComponent(url.substring(pos + 1));
   return null;
 }
 
 function testHash(aBrowser, aCallback) {
@@ -134,98 +102,69 @@ function testHash(aBrowser, aCallback) {
       is(addonData.isBlocklisted, aAddon.blocklistState == Ci.nsIBlocklistService.STATE_BLOCKED, "blocklisted should be correct");
       is(addonData.isCompatible, aAddon.isCompatible, "isCompatible should be correct");
     });
 
     aCallback();
   });
 }
 
-function isLoading() {
-  return gManagerWindow.document.getElementById("discover-view").selectedPanel ==
-         gManagerWindow.document.getElementById("discover-loading");
-}
-
-function isError() {
-  return gManagerWindow.document.getElementById("discover-view").selectedPanel ==
-         gManagerWindow.document.getElementById("discover-error");
-}
-
-function clickLink(aId, aCallback) {
-  var browser = gManagerWindow.document.getElementById("discover-browser");
-  browser.addProgressListener(gProgressListener);
-
-  gLoadCompleteCallback = function() {
-    browser.removeProgressListener(gProgressListener);
-    aCallback();
-  };
-
-  var link = browser.contentDocument.getElementById(aId);
-  EventUtils.synthesizeMouse(link, 2, 2, { }, browser.contentWindow);
-}
-
 // Tests that switching to the discovery view displays the right url
 add_test(function() {
   open_manager("addons://list/extension", function(aWindow) {
     gManagerWindow = aWindow;
     gCategoryUtilities = new CategoryUtilities(gManagerWindow);
 
     gCategoryUtilities.openType("discover", function() {
       var browser = gManagerWindow.document.getElementById("discover-browser");
-      is(getURL(browser), MAIN_URL, "Should have loaded the right url");
+      is(getURL(browser), TESTROOT + "releaseNotes.xhtml", "Should have loaded the right url");
 
       testHash(browser, function() {
         close_manager(gManagerWindow, run_next_test);
       });
     });
-
-    ok(isLoading(), "Should be loading at first");
   });
 });
 
 // Tests that loading the add-ons manager with the discovery view as the last
 // selected view displays the right url
 add_test(function() {
   open_manager(null, function(aWindow) {
+    gManagerWindow = aWindow;
     gCategoryUtilities = new CategoryUtilities(gManagerWindow);
     is(gCategoryUtilities.selectedCategory, "discover", "Should have loaded the right view");
 
     var browser = gManagerWindow.document.getElementById("discover-browser");
-    is(getURL(browser), MAIN_URL, "Should have loaded the right url");
+    is(getURL(browser), TESTROOT + "releaseNotes.xhtml", "Should have loaded the right url");
 
     testHash(browser, function() {
       close_manager(gManagerWindow, run_next_test);
     });
-  }, function(aWindow) {
-    gManagerWindow = aWindow;
-    ok(isLoading(), "Should be loading at first");
   });
 });
 
 // Tests that loading the add-ons manager with the discovery view as the initial
 // view displays the right url
 add_test(function() {
   open_manager(null, function(aWindow) {
     gManagerWindow = aWindow;
     gCategoryUtilities = new CategoryUtilities(gManagerWindow);
     gCategoryUtilities.openType("extension", function() {
       close_manager(gManagerWindow, function() {
         open_manager("addons://discover/", function(aWindow) {
+          gManagerWindow = aWindow;
           gCategoryUtilities = new CategoryUtilities(gManagerWindow);
           is(gCategoryUtilities.selectedCategory, "discover", "Should have loaded the right view");
 
           var browser = gManagerWindow.document.getElementById("discover-browser");
-          is(getURL(browser), MAIN_URL, "Should have loaded the right url");
+          is(getURL(browser), TESTROOT + "releaseNotes.xhtml", "Should have loaded the right url");
 
           testHash(browser, function() {
             close_manager(gManagerWindow, run_next_test);
           });
-        }, function(aWindow) {
-          gManagerWindow = aWindow;
-          ok(isLoading(), "Should be loading at first");
         });
       });
     });
   });
 });
 
 // Tests that switching to the discovery view displays the right url
 add_test(function() {
@@ -236,34 +175,34 @@ add_test(function() {
   });
 
   open_manager("addons://list/extension", function(aWindow) {
     gManagerWindow = aWindow;
     gCategoryUtilities = new CategoryUtilities(gManagerWindow);
 
     gCategoryUtilities.openType("discover", function() {
       var browser = gManagerWindow.document.getElementById("discover-browser");
-      is(getURL(browser), MAIN_URL, "Should have loaded the right url");
+      is(getURL(browser), TESTROOT + "releaseNotes.xhtml", "Should have loaded the right url");
 
       is(getHash(browser), null, "Hash should not have been passed");
       close_manager(gManagerWindow, run_next_test);
     });
   });
 });
 
 // Tests that loading the add-ons manager with the discovery view as the last
 // selected view displays the right url
 add_test(function() {
   open_manager(null, function(aWindow) {
     gManagerWindow = aWindow;
     gCategoryUtilities = new CategoryUtilities(gManagerWindow);
     is(gCategoryUtilities.selectedCategory, "discover", "Should have loaded the right view");
 
     var browser = gManagerWindow.document.getElementById("discover-browser");
-    is(getURL(browser), MAIN_URL, "Should have loaded the right url");
+    is(getURL(browser), TESTROOT + "releaseNotes.xhtml", "Should have loaded the right url");
 
     is(getHash(browser), null, "Hash should not have been passed");
     close_manager(gManagerWindow, run_next_test);
   });
 });
 
 // Tests that loading the add-ons manager with the discovery view as the initial
 // view displays the right url
@@ -274,216 +213,17 @@ add_test(function() {
     gCategoryUtilities.openType("extension", function() {
       close_manager(gManagerWindow, function() {
         open_manager("addons://discover/", function(aWindow) {
           gManagerWindow = aWindow;
           gCategoryUtilities = new CategoryUtilities(gManagerWindow);
           is(gCategoryUtilities.selectedCategory, "discover", "Should have loaded the right view");
 
           var browser = gManagerWindow.document.getElementById("discover-browser");
-          is(getURL(browser), MAIN_URL, "Should have loaded the right url");
+          is(getURL(browser), TESTROOT + "releaseNotes.xhtml", "Should have loaded the right url");
 
           is(getHash(browser), null, "Hash should not have been passed");
           close_manager(gManagerWindow, run_next_test);
         });
       });
     });
   });
 });
-
-// Tests that navigating to an insecure page fails
-add_test(function() {
-  open_manager("addons://discover/", function(aWindow) {
-    gManagerWindow = aWindow;
-    gCategoryUtilities = new CategoryUtilities(gManagerWindow);
-
-    var browser = gManagerWindow.document.getElementById("discover-browser");
-    is(getURL(browser), MAIN_URL, "Should have loaded the right url");
-
-    clickLink("link-http", function() {
-      ok(isError(), "Should have shown the error page");
-
-      gCategoryUtilities.openType("extension", function() {
-        gCategoryUtilities.openType("discover", function() {
-          is(getURL(browser), MAIN_URL, "Should have loaded the right url");
-
-          close_manager(gManagerWindow, run_next_test);
-        });
-        ok(isLoading(), "Should start loading again");
-      });
-    });
-  });
-});
-
-// Tests that navigating to a different domain fails
-add_test(function() {
-  open_manager("addons://discover/", function(aWindow) {
-    gManagerWindow = aWindow;
-    gCategoryUtilities = new CategoryUtilities(gManagerWindow);
-
-    var browser = gManagerWindow.document.getElementById("discover-browser");
-    is(getURL(browser), MAIN_URL, "Should have loaded the right url");
-
-    clickLink("link-domain", function() {
-      ok(isError(), "Should have shown the error page");
-
-      gCategoryUtilities.openType("extension", function() {
-        gCategoryUtilities.openType("discover", function() {
-          is(getURL(browser), MAIN_URL, "Should have loaded the right url");
-
-          close_manager(gManagerWindow, run_next_test);
-        });
-        ok(isLoading(), "Should start loading again");
-      });
-    });
-  });
-});
-
-// Tests that navigating to a missing page fails
-add_test(function() {
-  open_manager("addons://discover/", function(aWindow) {
-    gManagerWindow = aWindow;
-    gCategoryUtilities = new CategoryUtilities(gManagerWindow);
-
-    var browser = gManagerWindow.document.getElementById("discover-browser");
-    is(getURL(browser), MAIN_URL, "Should have loaded the right url");
-
-    clickLink("link-bad", function() {
-      ok(isError(), "Should have shown the error page");
-
-      gCategoryUtilities.openType("extension", function() {
-        gCategoryUtilities.openType("discover", function() {
-          is(getURL(browser), MAIN_URL, "Should have loaded the right url");
-
-          close_manager(gManagerWindow, run_next_test);
-        });
-        ok(isLoading(), "Should start loading again");
-      });
-    });
-  });
-});
-
-// Tests that navigating to a page on the same domain works
-add_test(function() {
-  open_manager("addons://discover/", function(aWindow) {
-    gManagerWindow = aWindow;
-    gCategoryUtilities = new CategoryUtilities(gManagerWindow);
-
-    var browser = gManagerWindow.document.getElementById("discover-browser");
-    is(getURL(browser), MAIN_URL, "Should have loaded the right url");
-
-    clickLink("link-good", function() {
-      is(getURL(browser), "https://example.com/" + RELATIVE_DIR + "releaseNotes.xhtml", "Should have loaded the right url");
-
-      gCategoryUtilities.openType("extension", function() {
-        gCategoryUtilities.openType("discover", function() {
-          is(getURL(browser), "https://example.com/" + RELATIVE_DIR + "releaseNotes.xhtml", "Should have loaded the right url");
-
-          close_manager(gManagerWindow, run_next_test);
-        });
-      });
-    });
-  });
-});
-
-// Tests repeated navigation to the same page followed by a navigation to a
-// different domain
-add_test(function() {
-  open_manager("addons://discover/", function(aWindow) {
-    gManagerWindow = aWindow;
-    gCategoryUtilities = new CategoryUtilities(gManagerWindow);
-
-    var browser = gManagerWindow.document.getElementById("discover-browser");
-    is(getURL(browser), MAIN_URL, "Should have loaded the right url");
-
-    var count = 10;
-    function clickAgain(aCallback) {
-      if (count-- == 0)
-        aCallback();
-      else
-        clickLink("link-normal", clickAgain.bind(null, aCallback));
-    }
-
-    clickAgain(function() {
-      is(getURL(browser), MAIN_URL, "Should have loaded the right url");
-
-      clickLink("link-domain", function() {
-        ok(isError(), "Should have shown the error page");
-
-        gCategoryUtilities.openType("extension", function() {
-          gCategoryUtilities.openType("discover", function() {
-            is(getURL(browser), MAIN_URL, "Should have loaded the right url");
-
-            close_manager(gManagerWindow, run_next_test);
-          });
-          ok(isLoading(), "Should start loading again");
-        });
-      });
-    });
-  });
-});
-
-// Loading an insecure main page should work if that is what the prefs say, should
-// also be able to navigate to a https page and back again
-add_test(function() {
-  Services.prefs.setCharPref(PREF_DISCOVERURL, TESTROOT + "discovery.html");
-
-  open_manager("addons://discover/", function(aWindow) {
-    gManagerWindow = aWindow;
-    gCategoryUtilities = new CategoryUtilities(gManagerWindow);
-
-    var browser = gManagerWindow.document.getElementById("discover-browser");
-    is(getURL(browser), TESTROOT + "discovery.html", "Should have loaded the right url");
-
-    clickLink("link-normal", function() {
-      is(getURL(browser), MAIN_URL, "Should have loaded the right url");
-
-      clickLink("link-http", function() {
-        is(getURL(browser), TESTROOT + "discovery.html", "Should have loaded the right url");
-
-        close_manager(gManagerWindow, run_next_test);
-      });
-    });
-  });
-});
-
-// Stopping the initial load should display the error page and then correctly
-// reload when switching away and back again
-add_test(function() {
-  Services.prefs.setCharPref(PREF_DISCOVERURL, MAIN_URL);
-
-  open_manager("addons://list/extension", function(aWindow) {
-    gManagerWindow = aWindow;
-    gCategoryUtilities = new CategoryUtilities(gManagerWindow);
-
-    var browser = gManagerWindow.document.getElementById("discover-browser");
-
-    EventUtils.synthesizeMouse(gCategoryUtilities.get("discover"), 2, 2, { }, gManagerWindow);
-
-    wait_for_view_load(gManagerWindow, function() {
-      ok(isError(), "Should have shown the error page");
-
-      gCategoryUtilities.openType("extension", function() {
-        EventUtils.synthesizeMouse(gCategoryUtilities.get("discover"), 2, 2, { }, gManagerWindow);
-
-        wait_for_view_load(gManagerWindow, function() {
-          ok(isError(), "Should have shown the error page");
-
-          gCategoryUtilities.openType("extension", function() {
-            gCategoryUtilities.openType("discover", function() {
-              is(getURL(browser), MAIN_URL, "Should have loaded the right url");
-
-              close_manager(gManagerWindow, run_next_test);
-            });
-          });
-        });
-
-        ok(isLoading(), "Should be loading");
-        // This will stop the real page load
-        browser.stop();
-      });
-    });
-
-    ok(isLoading(), "Should be loading");
-    // This will actually stop the about:blank load
-    browser.stop();
-  });
-});
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/browser/discovery.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<html>
-<body>
-  <h1>Test page for the discovery pane</h1>
-  <p><a id="link-normal" href="https://example.com/browser/toolkit/mozapps/extensions/test/browser/discovery.html">Load normal</a></p>
-  <p><a id="link-http" href="http://example.com/browser/toolkit/mozapps/extensions/test/browser/discovery.html">Load insecure</a></p>
-  <p><a id="link-domain" href="https://test1.example.com/browser/toolkit/mozapps/extensions/test/browser/discovery.html">Load other domain</a></p>
-  <p><a id="link-bad" href="https://example.com/browser/toolkit/mozapps/extensions/test/browser/foo.html">Load missing page</a></p>
-  <p><a id="link-good" href="https://example.com/browser/toolkit/mozapps/extensions/test/browser/releaseNotes.xhtml">Load other page</a></p>
-</body>
-</html>
--- a/toolkit/mozapps/extensions/test/browser/head.js
+++ b/toolkit/mozapps/extensions/test/browser/head.js
@@ -76,27 +76,16 @@ registerCleanupFunction(function() {
         return;
 
       ok(false, "Should not have seen an install of " + aInstall.sourceURI.spec + " in state " + aInstall.state);
       aInstall.cancel();
     });
   });
 });
 
-function log_exceptions(aCallback) {
-  try {
-    var args = Array.slice(arguments, 1);
-    return aCallback.apply(null, args);
-  }
-  catch (e) {
-    info("Exception thrown: " + e);
-    throw e;
-  }
-}
-
 function add_test(test) {
   gPendingTests.push(test);
 }
 
 function run_next_test() {
   if (gTestsRun > 0)
     info("Test " + gTestsRun + " took " + (Date.now() - gTestStart) + "ms");
 
@@ -108,17 +97,17 @@ function run_next_test() {
   gTestsRun++;
   var test = gPendingTests.shift();
   if (test.name)
     info("Running test " + gTestsRun + " (" + test.name + ")");
   else
     info("Running test " + gTestsRun);
 
   gTestStart = Date.now();
-  log_exceptions(test);
+  test();
 }
 
 function get_addon_file_url(aFilename) {
   try {
     var cr = Cc["@mozilla.org/chrome/chrome-registry;1"].
              getService(Ci.nsIChromeRegistry);
     var fileurl = cr.convertChromeURL(makeURI(CHROMEROOT + "addons/" + aFilename));
     return fileurl.QueryInterface(Ci.nsIFileURL);
@@ -199,43 +188,43 @@ function get_addon_element(aManager, aId
   }
   return null;
 }
 
 function wait_for_view_load(aManagerWindow, aCallback, aForceWait, aLongerTimeout) {
   requestLongerTimeout(aLongerTimeout ? aLongerTimeout : 2);
 
   if (!aForceWait && !aManagerWindow.gViewController.isLoading) {
-    log_exceptions(aCallback, aManagerWindow);
+    aCallback(aManagerWindow);
     return;
   }
 
   aManagerWindow.document.addEventListener("ViewChanged", function() {
     aManagerWindow.document.removeEventListener("ViewChanged", arguments.callee, false);
-    log_exceptions(aCallback, aManagerWindow);
+    aCallback(aManagerWindow);
   }, false);
 }
 
 function wait_for_manager_load(aManagerWindow, aCallback) {
   if (!aManagerWindow.gIsInitializing) {
-    log_exceptions(aCallback, aManagerWindow);
+    aCallback(aManagerWindow);
     return;
   }
 
   info("Waiting for initialization");
   aManagerWindow.document.addEventListener("Initialized", function() {
     aManagerWindow.document.removeEventListener("Initialized", arguments.callee, false);
-    log_exceptions(aCallback, aManagerWindow);
+    aCallback(aManagerWindow);
   }, false);
 }
 
 function open_manager(aView, aCallback, aLoadCallback, aLongerTimeout) {
   function setup_manager(aManagerWindow) {
     if (aLoadCallback)
-      log_exceptions(aLoadCallback, aManagerWindow);
+      aLoadCallback(aManagerWindow);
 
     if (aView)
       aManagerWindow.loadView(aView);
 
     ok(aManagerWindow != null, "Should have an add-ons manager window");
     is(aManagerWindow.location, MANAGER_URI, "Should be displaying the correct UI");
 
     wait_for_manager_load(aManagerWindow, function() {
@@ -260,17 +249,17 @@ function open_manager(aView, aCallback, 
 function close_manager(aManagerWindow, aCallback, aLongerTimeout) {
   requestLongerTimeout(aLongerTimeout ? aLongerTimeout : 2);
 
   ok(aManagerWindow != null, "Should have an add-ons manager window to close");
   is(aManagerWindow.location, MANAGER_URI, "Should be closing window with correct URI");
 
   aManagerWindow.addEventListener("unload", function() {
     this.removeEventListener("unload", arguments.callee, false);
-    log_exceptions(aCallback);
+    aCallback();
   }, false);
 
   aManagerWindow.close();
 }
 
 function restart_manager(aManagerWindow, aView, aCallback, aLoadCallback) {
   if (!aManagerWindow) {
     open_manager(aView, aCallback, aLoadCallback);
deleted file mode 100644
index cd50735a8943c0b63d42b33064c9411fe2900d5f..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
--- a/toolkit/themes/gnomestripe/mozapps/extensions/extensions.css
+++ b/toolkit/themes/gnomestripe/mozapps/extensions/extensions.css
@@ -353,50 +353,16 @@
 }
 
 .sorter[checkState="2"] .button-icon {
   display: -moz-box;
   list-style-image: url("moz-icon://stock/gtk-sort-ascending?size=16");
 }
 
 
-/*** discover view ***/
-
-.discover-spacer-before,
-.discover-spacer-after {
-  -moz-box-flex: 1;
-}
-
-#discover-error .alert {
-  max-width: 45em;
-  -moz-box-flex: 1;
-}
-
-.discover-logo {
-  list-style-image: url("chrome://mozapps/skin/extensions/discover-logo.png");
-  -moz-margin-end: 15px;
-}
-
-.discover-title {
-  font-weight: bold;
-  font-size: 24px;
-  font-family: MetaWebPro-Book, "Trebuchet MS", sans-serif;
-  margin: 0 0 15px 0;
-}
-
-.discover-description {
-  text-align: justify;
-  margin: 0 0 15px 0;
-}
-
-.discover-footer {
-  text-align: justify;
-}
-
-
 /*** list ***/
 
 .list {
   -moz-appearance: none;
   margin: 0;
   border: none;
   background-color: transparent;
 }
--- a/toolkit/themes/gnomestripe/mozapps/jar.mn
+++ b/toolkit/themes/gnomestripe/mozapps/jar.mn
@@ -8,17 +8,16 @@ toolkit.jar:
 + skin/classic/mozapps/extensions/category-discover.png    (extensions/category-discover.png)
 + skin/classic/mozapps/extensions/category-languages.png   (extensions/category-languages.png)
 + skin/classic/mozapps/extensions/category-searchengines.png (extensions/category-searchengines.png)
 + skin/classic/mozapps/extensions/category-extensions.png  (extensions/category-extensions.png)
 + skin/classic/mozapps/extensions/category-themes.png      (extensions/category-themes.png)
 + skin/classic/mozapps/extensions/category-plugins.png     (extensions/category-plugins.png)
 + skin/classic/mozapps/extensions/category-recent.png      (extensions/category-recent.png)
 + skin/classic/mozapps/extensions/category-available.png   (extensions/category-available.png)
-+ skin/classic/mozapps/extensions/discover-logo.png        (extensions/discover-logo.png)
 + skin/classic/mozapps/extensions/extensionGeneric.png     (extensions/extensionGeneric.png)
 + skin/classic/mozapps/extensions/extensionGeneric-16.png  (extensions/extensionGeneric-16.png)
 + skin/classic/mozapps/extensions/themeGeneric.png         (extensions/themeGeneric.png)
 + skin/classic/mozapps/extensions/themeGeneric-16.png      (extensions/themeGeneric-16.png)
 + skin/classic/mozapps/extensions/localeGeneric.png        (extensions/localeGeneric.png)
 + skin/classic/mozapps/extensions/rating-won.png           (extensions/rating-won.png)
 + skin/classic/mozapps/extensions/rating-not-won.png       (extensions/rating-not-won.png)
 + skin/classic/mozapps/extensions/cancel.png               (extensions/cancel.png)
deleted file mode 100644
index cd50735a8943c0b63d42b33064c9411fe2900d5f..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
--- a/toolkit/themes/pinstripe/mozapps/extensions/extensions.css
+++ b/toolkit/themes/pinstripe/mozapps/extensions/extensions.css
@@ -170,17 +170,17 @@
   margin-bottom: 15px;
 }
 
 .alert .addon-control {
   margin: 1em 2em;
 }
 
 .loading {
-  list-style-image: url("chrome://global/skin/icons/loading_16.png");
+ list-style-image: url("chrome://global/skin/icons/loading_16.png");
   padding-left: 20px;
   padding-right: 20px;
 }
 
 
 
 /*** category selector ***/
 
@@ -383,50 +383,16 @@
   list-style-image: url("chrome://global/skin/arrow/arrow-up.gif");
 }
 
 .sorter .button-icon {
   -moz-margin-start: 4px;
 }
 
 
-/*** discover view ***/
-
-.discover-spacer-before,
-.discover-spacer-after {
-  -moz-box-flex: 1;
-}
-
-#discover-error .alert {
-  max-width: 45em;
-  -moz-box-flex: 1;
-}
-
-.discover-logo {
-  list-style-image: url("chrome://mozapps/skin/extensions/discover-logo.png");
-  -moz-margin-end: 15px;
-}
-
-.discover-title {
-  font-weight: bold;
-  font-size: 24px;
-  font-family: MetaWebPro-Book, "Trebuchet MS", sans-serif;
-  margin: 0 0 15px 0;
-}
-
-.discover-description {
-  text-align: justify;
-  margin: 0 0 15px 0;
-}
-
-.discover-footer {
-  text-align: justify;
-}
-
-
 /*** list ***/
 
 .list {
   -moz-appearance: none;
   margin: 0;
   border: none;
   background-color: transparent;
 }
--- a/toolkit/themes/pinstripe/mozapps/jar.mn
+++ b/toolkit/themes/pinstripe/mozapps/jar.mn
@@ -9,17 +9,16 @@ toolkit.jar:
   skin/classic/mozapps/extensions/category-discover.png           (extensions/category-discover.png)
   skin/classic/mozapps/extensions/category-languages.png          (extensions/category-languages.png)
   skin/classic/mozapps/extensions/category-searchengines.png      (extensions/category-searchengines.png)
   skin/classic/mozapps/extensions/category-extensions.png         (extensions/category-extensions.png)
   skin/classic/mozapps/extensions/category-themes.png             (extensions/category-themes.png)
   skin/classic/mozapps/extensions/category-plugins.png            (extensions/category-plugins.png)
   skin/classic/mozapps/extensions/category-recent.png             (extensions/category-recent.png)
   skin/classic/mozapps/extensions/category-available.png          (extensions/category-available.png)
-  skin/classic/mozapps/extensions/discover-logo.png               (extensions/discover-logo.png)
   skin/classic/mozapps/extensions/extensionGeneric.png            (extensions/extensionGeneric.png)
   skin/classic/mozapps/extensions/extensionGeneric-16.png         (extensions/extensionGeneric-16.png)
   skin/classic/mozapps/extensions/themeGeneric.png                (extensions/themeGeneric.png)
   skin/classic/mozapps/extensions/themeGeneric-16.png             (extensions/themeGeneric-16.png)
   skin/classic/mozapps/extensions/localeGeneric.png               (extensions/localeGeneric.png)
   skin/classic/mozapps/extensions/rating-won.png                  (extensions/rating-won.png)
   skin/classic/mozapps/extensions/rating-not-won.png              (extensions/rating-not-won.png)
   skin/classic/mozapps/extensions/cancel.png                      (extensions/cancel.png)
deleted file mode 100644
index cd50735a8943c0b63d42b33064c9411fe2900d5f..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
--- a/toolkit/themes/winstripe/mozapps/extensions/extensions.css
+++ b/toolkit/themes/winstripe/mozapps/extensions/extensions.css
@@ -440,50 +440,16 @@
   list-style-image: url("chrome://global/skin/arrow/arrow-up.gif");
 }
 
 .sorter .button-icon {
   -moz-margin-start: 4px;
 }
 
 
-/*** discover view ***/
-
-.discover-spacer-before,
-.discover-spacer-after {
-  -moz-box-flex: 1;
-}
-
-#discover-error .alert {
-  max-width: 45em;
-  -moz-box-flex: 1;
-}
-
-.discover-logo {
-  list-style-image: url("chrome://mozapps/skin/extensions/discover-logo.png");
-  -moz-margin-end: 15px;
-}
-
-.discover-title {
-  font-weight: bold;
-  font-size: 24px;
-  font-family: MetaWebPro-Book, "Trebuchet MS", sans-serif;
-  margin: 0 0 15px 0;
-}
-
-.discover-description {
-  text-align: justify;
-  margin: 0 0 15px 0;
-}
-
-.discover-footer {
-  text-align: justify;
-}
-
-
 /*** list ***/
 
 .list {
   -moz-appearance: none;
   margin: 0;
   border: none;
   background-color: transparent;
 }
--- a/toolkit/themes/winstripe/mozapps/jar.mn
+++ b/toolkit/themes/winstripe/mozapps/jar.mn
@@ -16,17 +16,16 @@ toolkit.jar:
         skin/classic/mozapps/extensions/category-discover.png      (extensions/category-discover.png)
         skin/classic/mozapps/extensions/category-languages.png     (extensions/category-languages.png)
         skin/classic/mozapps/extensions/category-searchengines.png (extensions/category-searchengines.png)
         skin/classic/mozapps/extensions/category-extensions.png    (extensions/category-extensions.png)
         skin/classic/mozapps/extensions/category-themes.png        (extensions/category-themes.png)
         skin/classic/mozapps/extensions/category-plugins.png       (extensions/category-plugins.png)
         skin/classic/mozapps/extensions/category-recent.png        (extensions/category-recent.png)
         skin/classic/mozapps/extensions/category-available.png     (extensions/category-available.png)
-        skin/classic/mozapps/extensions/discover-logo.png          (extensions/discover-logo.png)
         skin/classic/mozapps/extensions/extensionGeneric.png       (extensions/extensionGeneric.png)
         skin/classic/mozapps/extensions/extensionGeneric-16.png    (extensions/extensionGeneric-16.png)
         skin/classic/mozapps/extensions/themeGeneric.png           (extensions/themeGeneric.png)
         skin/classic/mozapps/extensions/themeGeneric-16.png        (extensions/themeGeneric-16.png)
         skin/classic/mozapps/extensions/localeGeneric.png          (extensions/localeGeneric.png)
         skin/classic/mozapps/extensions/rating-won.png             (extensions/rating-won.png)
         skin/classic/mozapps/extensions/rating-not-won.png         (extensions/rating-not-won.png)
         skin/classic/mozapps/extensions/cancel.png                 (extensions/cancel.png)
@@ -92,17 +91,16 @@ toolkit.jar:
         skin/classic/aero/mozapps/extensions/category-discover.png         (extensions/category-discover-aero.png)
         skin/classic/aero/mozapps/extensions/category-languages.png        (extensions/category-languages-aero.png)
         skin/classic/aero/mozapps/extensions/category-searchengines.png    (extensions/category-searchengines.png)
         skin/classic/aero/mozapps/extensions/category-extensions.png       (extensions/category-extensions-aero.png)
         skin/classic/aero/mozapps/extensions/category-themes.png           (extensions/category-themes-aero.png)
         skin/classic/aero/mozapps/extensions/category-plugins.png          (extensions/category-plugins-aero.png)
         skin/classic/aero/mozapps/extensions/category-recent.png           (extensions/category-recent-aero.png)
         skin/classic/aero/mozapps/extensions/category-available.png        (extensions/category-available-aero.png)
-        skin/classic/aero/mozapps/extensions/discover-logo.png             (extensions/discover-logo.png)
         skin/classic/aero/mozapps/extensions/extensionGeneric.png          (extensions/extensionGeneric-aero.png)
         skin/classic/aero/mozapps/extensions/extensionGeneric-16.png       (extensions/extensionGeneric-16-aero.png)
         skin/classic/aero/mozapps/extensions/themeGeneric.png              (extensions/themeGeneric-aero.png)
         skin/classic/aero/mozapps/extensions/themeGeneric-16.png           (extensions/themeGeneric-16-aero.png)
         skin/classic/aero/mozapps/extensions/localeGeneric.png             (extensions/localeGeneric-aero.png)
         skin/classic/aero/mozapps/extensions/rating-won.png                (extensions/rating-won.png)
         skin/classic/aero/mozapps/extensions/rating-not-won.png            (extensions/rating-not-won.png)
         skin/classic/aero/mozapps/extensions/cancel.png                    (extensions/cancel.png)