Bug 703929 - Loading in the Get Add-ons pane a chrome XUL file fails when the add-on manager is reopened, r=Mossop.
authorFlorian Queze <florian@queze.net>
Thu, 15 Dec 2011 17:08:49 +0100
changeset 82663 bb6812611234e2e7a0ee74120c45c072d721a0b7
parent 82662 36fa9b176a915490c892378a3c568725f5d563e4
child 82664 2dcafeb76514fb00e9318eb8f8e2eef778b60721
push id21693
push userbmo@edmorley.co.uk
push dateFri, 16 Dec 2011 01:34:58 +0000
treeherdermozilla-central@c8b8b310f27e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMossop
bugs703929
milestone11.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
Bug 703929 - Loading in the Get Add-ons pane a chrome XUL file fails when the add-on manager is reopened, r=Mossop.
toolkit/mozapps/extensions/content/extensions.js
toolkit/mozapps/extensions/test/browser/browser_discovery.js
--- a/toolkit/mozapps/extensions/content/extensions.js
+++ b/toolkit/mozapps/extensions/content/extensions.js
@@ -1993,17 +1993,18 @@ var gDiscoverView = {
 
     // Consider the successful load of about:blank as still loading
     if (aRequest instanceof Ci.nsIChannel && aRequest.URI.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) ||
+    const NS_ERROR_PARSED_DATA_CACHED = 0x805D0021;
+    if (!(Components.isSuccessCode(aStatus) || aStatus == NS_ERROR_PARSED_DATA_CACHED) ||
         (aRequest && aRequest instanceof Ci.nsIHttpChannel && !aRequest.requestSucceeded)) {
       this.showError();
     } else {
       // Got a successful load, make sure the browser is visible
       this.node.selectedPanel = this._browser;
       gViewController.updateCommands();
     }
 
--- a/toolkit/mozapps/extensions/test/browser/browser_discovery.js
+++ b/toolkit/mozapps/extensions/test/browser/browser_discovery.js
@@ -508,8 +508,33 @@ add_test(function() {
       });
     });
 
     ok(isLoading(), "Should be loading");
     // This will actually stop the about:blank load
     browser.stop();
   });
 });
+
+// Test for Bug 703929 - Loading the discover view from a chrome XUL file fails when
+// the add-on manager is reopened.
+add_test(function() {
+  const url = "chrome://mochitests/content/" +  RELATIVE_DIR + "addon_about.xul";
+  Services.prefs.setCharPref(PREF_DISCOVERURL, url);
+
+  open_manager("addons://discover/", function(aWindow) {
+    gManagerWindow = aWindow;
+    gCategoryUtilities = new CategoryUtilities(gManagerWindow);
+
+    var browser = gManagerWindow.document.getElementById("discover-browser");
+    is(getURL(browser), url, "Loading a chrome XUL file should work");
+
+    restart_manager(gManagerWindow, "addons://discover/", function(aWindow) {
+      gManagerWindow = aWindow;
+      gCategoryUtilities = new CategoryUtilities(gManagerWindow);
+
+      var browser = gManagerWindow.document.getElementById("discover-browser");
+      is(getURL(browser), url, "Should be able to load the chrome XUL file a second time");
+
+      close_manager(gManagerWindow, run_next_test);
+    });
+  });
+});