Bug 1590503 - Follow up: fix failing test. r=jorgk
authorAlessandro Castellani <alessandro@thunderbird.net>
Wed, 30 Oct 2019 21:59:19 +0100
changeset 37405 11e4fa28d82fc4b18d4feb08fb142c7c182bc6bb
parent 37404 0b86712778503e41a841ffc85a516f7f22179c78
child 37406 57532519642ed0f8ebe64531327c1977f91aeb06
push id396
push userclokep@gmail.com
push dateMon, 06 Jan 2020 23:11:57 +0000
reviewersjorgk
bugs1590503
Bug 1590503 - Follow up: fix failing test. r=jorgk
mail/components/accountcreation/content/emailWizard.js
--- a/mail/components/accountcreation/content/emailWizard.js
+++ b/mail/components/accountcreation/content/emailWizard.js
@@ -281,21 +281,22 @@ EmailConfigWizard.prototype = {
     window.sizeToContent();
   },
 
   /**
    * Resize the window based on the content height and width.
    * Since the sizeToContent() method doesn't account for the height of
    * wrapped text, we're checking if the width and height of the "mastervbox"
    * is taller than the window width and height. This is necessary to account
-   * for l10n strings or the user manually resizing the window. Bug 1590503.
+   * for l10n strings or the user manually resizing the window.
    */
   resizeDialog() {
-    let contentHeight = document.getElementById("mastervbox").clientHeight;
-    let contentWidth = document.getElementById("mastervbox").clientWidth;
+    let mastervbox = document.getElementById("mastervbox");
+    let contentHeight = mastervbox.clientHeight;
+    let contentWidth = mastervbox.clientWidth;
 
     if (contentHeight > window.innerHeight) {
       window.innerHeight = contentHeight;
     }
 
     if (contentWidth > window.innerWidth) {
       window.innerWidth = contentWidth;
     }
@@ -2000,22 +2001,22 @@ EmailConfigWizard.prototype = {
       },
       function(e) {
         // failed
         // Could be a wrong password, but there are 1000 other
         // reasons why this failed. Only the backend knows.
         // If we got no message, then something other than VerifyLogon failed.
         self.showErrorMsg(e.message || e.toString());
 
-        this.resizeDialog();
         // TODO use switchToMode(), see above
         // give user something to proceed after fixing
         _enable("create_button");
         // hidden in non-manual mode, so it's fine to enable
         _enable("half-manual-test_button");
+        self.resizeDialog();
       }
     );
   },
 
   finish(concreteConfig) {
     gEmailWizardLogger.info("creating account in backend");
     var account = createAccountInBackend(concreteConfig);