diff options
author | kelvinp@chromium.org <kelvinp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-17 05:03:05 +0000 |
---|---|---|
committer | kelvinp@chromium.org <kelvinp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-17 05:03:05 +0000 |
commit | c980b7dfaaeae8511be4ea4ff5799787d10d019c (patch) | |
tree | 46db656cef8cf9cefdfb320e44cac727bdcd2535 | |
parent | bdd509b41f76d278cb7194941ed0018a2b5edf36 (diff) | |
download | chromium_src-c980b7dfaaeae8511be4ea4ff5799787d10d019c.zip chromium_src-c980b7dfaaeae8511be4ea4ff5799787d10d019c.tar.gz chromium_src-c980b7dfaaeae8511be4ea4ff5799787d10d019c.tar.bz2 |
Handle host need upgrade in Pin browser test
This CL handles create a helper method in browser_tests to dismiss the host-out-of-date warning if it is displayed.
BUG=393072
Review URL: https://codereview.chromium.org/389673003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@283647 0039d316-1c4b-4281-b951-d872f2087c98
4 files changed, 20 insertions, 14 deletions
diff --git a/remoting/webapp/browser_test/browser_test.js b/remoting/webapp/browser_test/browser_test.js index 7860002..2c385bb 100644 --- a/remoting/webapp/browser_test/browser_test.js +++ b/remoting/webapp/browser_test/browser_test.js @@ -156,6 +156,21 @@ browserTest.onUIMode = function(expectedMode, opt_timeout) { }); }; +browserTest.connectMe2Me = function() { + var AppMode = remoting.AppMode; + browserTest.clickOnControl('this-host-connect'); + return browserTest.onUIMode(AppMode.CLIENT_HOST_NEEDS_UPGRADE).then( + function() { + // On fulfilled. + browserTest.clickOnControl('host-needs-update-connect-button'); + }, function() { + // On time out. + return Promise.resolve(); + }).then(function() { + return browserTest.onUIMode(AppMode.CLIENT_PIN_PROMPT); + }); +} + browserTest.expectMe2MeError = function(errorTag) { var AppMode = remoting.AppMode; var Timeout = browserTest.Timeout; diff --git a/remoting/webapp/browser_test/cancel_pin_browser_test.js b/remoting/webapp/browser_test/cancel_pin_browser_test.js index 7ba01c7..b388936 100644 --- a/remoting/webapp/browser_test/cancel_pin_browser_test.js +++ b/remoting/webapp/browser_test/cancel_pin_browser_test.js @@ -21,13 +21,11 @@ browserTest.Cancel_PIN.prototype.run = function(data) { browserTest.expect(typeof data.pin == 'string'); var AppMode = remoting.AppMode; - browserTest.clickOnControl('this-host-connect'); - browserTest.onUIMode(AppMode.CLIENT_PIN_PROMPT).then(function() { + browserTest.connectMe2Me().then(function() { browserTest.clickOnControl('cancel-pin-entry-button'); return browserTest.onUIMode(AppMode.HOME); }).then(function() { - browserTest.clickOnControl('this-host-connect'); - return browserTest.onUIMode(AppMode.CLIENT_PIN_PROMPT); + return browserTest.connectMe2Me() }).then( this.enterPin_.bind(this, data.pin) ).then(function() { diff --git a/remoting/webapp/browser_test/invalid_pin_browser_test.js b/remoting/webapp/browser_test/invalid_pin_browser_test.js index 5cdea3e1..480a7e8 100644 --- a/remoting/webapp/browser_test/invalid_pin_browser_test.js +++ b/remoting/webapp/browser_test/invalid_pin_browser_test.js @@ -21,9 +21,7 @@ browserTest.Invalid_PIN.prototype.run = function(data) { browserTest.expect(typeof data.pin == 'string'); // Connect to me2me Host. - browserTest.clickOnControl('this-host-connect'); - - browserTest.onUIMode(remoting.AppMode.CLIENT_PIN_PROMPT).then( + browserTest.connectMe2Me().then( this.enterPIN_.bind(this, data.pin) ).then( // Sleep for two seconds to allow the host backoff timer to reset. diff --git a/remoting/webapp/browser_test/update_pin_browser_test.js b/remoting/webapp/browser_test/update_pin_browser_test.js index 0d0eba5..7eed5aa 100644 --- a/remoting/webapp/browser_test/update_pin_browser_test.js +++ b/remoting/webapp/browser_test/update_pin_browser_test.js @@ -27,14 +27,14 @@ browserTest.Update_PIN.prototype.run = function(data) { 'The new PIN and the old PIN cannot be the same'); this.changePIN_(data.new_pin).then( - this.connect_.bind(this) + browserTest.connectMe2Me ).then( this.enterPIN_.bind(this, data.old_pin, true /* expectError*/) ).then( // Sleep for two seconds to allow for the login backoff logic to reset. base.Promise.sleep.bind(null, LOGIN_BACKOFF_WAIT) ).then( - this.connect_.bind(this) + browserTest.connectMe2Me ).then( this.enterPIN_.bind(this, data.new_pin, false /* expectError*/) ).then( @@ -72,11 +72,6 @@ browserTest.Update_PIN.prototype.changePIN_ = function(newPin) { }); }; -browserTest.Update_PIN.prototype.connect_ = function() { - browserTest.clickOnControl('this-host-connect'); - return browserTest.onUIMode(remoting.AppMode.CLIENT_PIN_PROMPT); -}; - browserTest.Update_PIN.prototype.disconnect_ = function() { var AppMode = remoting.AppMode; |