Commit 2c617467 authored by Florian Queze's avatar Florian Queze
Browse files

Bug 703929 - Loading in the Get Add-ons pane a chrome XUL file fails when the...

Bug 703929 - Loading in the Get Add-ons pane a chrome XUL file fails when the add-on manager is reopened, r=Mossop.
parent 1c679d8e
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1998,7 +1998,8 @@ var gDiscoverView = {
    // 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 {
+25 −0
Original line number Diff line number Diff line
@@ -513,3 +513,28 @@ add_test(function() {
    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);
    });
  });
});