Commit d5c4cc5f authored by Matthew Noorenberghe's avatar Matthew Noorenberghe
Browse files

Bug 1298543 - Fix test_prompt_http.html for e10s. r=Dolske

Don't actually test doorhanger notifications since they are only on the desktop browser and browser chrome tests already check them.

The Android notifyObservers additions aren't used in this patch but I added them for consistency and because we should start to use them for cross-platform tests that check if a doorhanger appears.

MozReview-Commit-ID: B5wK8oqu0h7

--HG--
rename : toolkit/components/passwordmgr/test/notification_common.js => toolkit/components/passwordmgr/test/chrome/notification_common.js
extra : rebase_source : 741f45a7dd64a1b7043040bec90bef4e5fd86c0e
parent fda75686
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -129,6 +129,7 @@ LoginManagerPrompter.prototype = {
  promptToSavePassword : function (aLogin) {
    this._showSaveLoginNotification(aLogin);
      Services.telemetry.getHistogramById("PWMGR_PROMPT_REMEMBER_ACTION").add(PROMPT_DISPLAYED);
    Services.obs.notifyObservers(aLogin, "passwordmgr-prompt-save", null);
  },

  /*
@@ -228,6 +229,8 @@ LoginManagerPrompter.prototype = {
  promptToChangePassword : function (aOldLogin, aNewLogin) {
    this._showChangeLoginNotification(aOldLogin, aNewLogin.password);
    Services.telemetry.getHistogramById("PWMGR_PROMPT_UPDATE_ACTION").add(PROMPT_DISPLAYED);
    let oldGUID = aOldLogin.QueryInterface(Ci.nsILoginMetaInfo).guid;
    Services.obs.notifyObservers(aNewLogin, "passwordmgr-prompt-change", oldGUID);
  },

  /*
+10 −0
Original line number Diff line number Diff line
@@ -1065,6 +1065,8 @@ LoginManagerPrompter.prototype = {
      this._showLoginNotification(aNotifyObj, "password-save",
                                  notificationText, buttons);
    }

    Services.obs.notifyObservers(aLogin, "passwordmgr-prompt-save", null);
  },

  _removeLoginNotifications : function () {
@@ -1144,6 +1146,8 @@ LoginManagerPrompter.prototype = {
      // userChoice == 1 --> just ignore the login.
      this.log("Ignoring login.");
    }

    Services.obs.notifyObservers(aLogin, "passwordmgr-prompt-save", null);
  },


@@ -1235,6 +1239,9 @@ LoginManagerPrompter.prototype = {
      this._showLoginNotification(aNotifyObj, "password-change",
                                  notificationText, buttons);
    }

    let oldGUID = aOldLogin.QueryInterface(Ci.nsILoginMetaInfo).guid;
    Services.obs.notifyObservers(aNewLogin, "passwordmgr-prompt-change", oldGUID);
  },


@@ -1265,6 +1272,9 @@ LoginManagerPrompter.prototype = {
      this.log("Updating password for user " + aOldLogin.username);
      this._updateLogin(aOldLogin, aNewLogin);
    }

    let oldGUID = aOldLogin.QueryInterface(Ci.nsILoginMetaInfo).guid;
    Services.obs.notifyObservers(aNewLogin, "passwordmgr-prompt-change", oldGUID);
  },


+1 −1
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@ skip-if = buildapp == 'b2g' || os == 'android'
skip-if = true # Bug 1173337
support-files =
  ../formsubmit.sjs
  ../notification_common.js
  notification_common.js
  privbrowsing_perwindowpb_iframe.html
  subtst_privbrowsing_1.html
  subtst_privbrowsing_2.html
+0 −1
Original line number Diff line number Diff line
@@ -4,7 +4,6 @@ support-files =
  authenticate.sjs
  blank.html
  formsubmit.sjs
  notification_common.js
  prompt_common.js
  pwmgr_common.js
  subtst_master_pass.html
Loading