From c4ad6289303190c87b6559a6270faba4408e138d Mon Sep 17 00:00:00 2001 From: Vlad Filippov Date: Wed, 29 Oct 2014 13:30:10 -0400 Subject: [PATCH] fix(oauth): fixes WebChannel double submit during password reset --- app/scripts/views/ready.js | 2 +- tests/functional/oauth_webchannel.js | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/app/scripts/views/ready.js b/app/scripts/views/ready.js index f3029b8b82..56f9227868 100644 --- a/app/scripts/views/ready.js +++ b/app/scripts/views/ready.js @@ -61,7 +61,7 @@ function (_, BaseView, Template, Session, Xss, Strings, var graphic = this.$el.find('.graphic'); graphic.addClass('pulse'); // Finish the WebChannel flow - if (this.relier.get('webChannelId')) { + if (this.isOAuthSameBrowser() && this.relier.get('webChannelId')) { this.submit(); } diff --git a/tests/functional/oauth_webchannel.js b/tests/functional/oauth_webchannel.js index fbf3f176cd..b635341a88 100644 --- a/tests/functional/oauth_webchannel.js +++ b/tests/functional/oauth_webchannel.js @@ -25,6 +25,7 @@ define([ var user; var email; var client; + var ANIMATION_DELAY_MS = 1000; /* global window, addEventListener */ /** @@ -335,6 +336,14 @@ define([ .findByCssSelector('#fxa-reset-password-complete-header') .end() + .sleep(ANIMATION_DELAY_MS) + + .findByCssSelector('.error').isDisplayed() + .then(function (isDisplayed) { + assert.isFalse(isDisplayed); + }) + .end() + .closeCurrentWindow() // switch to the original window .switchToWindow('')