Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(807)

Unified Diff: remoting/webapp/browser_test/browser_test.js

Issue 940713003: Enable PIN browser tests on the waterfall. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reviewers feedback Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | testing/chromoting/browser_test_commands_linux.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/browser_test/browser_test.js
diff --git a/remoting/webapp/browser_test/browser_test.js b/remoting/webapp/browser_test/browser_test.js
index f41591fd452113f768028de2611ea2c9ab1c5c19..88f9ee445615def71a2129d6535b266869ab5d95 100644
--- a/remoting/webapp/browser_test/browser_test.js
+++ b/remoting/webapp/browser_test/browser_test.js
@@ -190,9 +190,13 @@ 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() {
+ // The one second timeout is necessary because the click handler of
+ // 'this-host-connect' is registered asynchronously.
+ return base.Promise.sleep(1000).then(function() {
+ browserTest.clickOnControl('this-host-connect');
+ }).then(function(){
+ return browserTest.onUIMode(AppMode.CLIENT_HOST_NEEDS_UPGRADE);
+ }).then(function() {
// On fulfilled.
browserTest.clickOnControl('host-needs-update-connect-button');
}, function() {
@@ -259,15 +263,15 @@ browserTest.expectConnectionError = function(connectionMode, errorTag) {
var Timeout = browserTest.Timeout;
var finishButton = 'client-finished-me2me-button';
- var failureMode = AppMode.CLIENT_CONNECT_FAILED_ME2ME;
if (connectionMode == remoting.DesktopConnectedView.Mode.IT2ME) {
- failureMode = AppMode.CLIENT_CONNECT_FAILED_IT2ME;
finishButton = 'client-finished-it2me-button';
}
var onConnected = browserTest.onUIMode(AppMode.IN_SESSION, Timeout.NONE);
- var onFailure = browserTest.onUIMode(failureMode);
+ var onFailure = Promise.race([
+ browserTest.onUIMode(AppMode.CLIENT_CONNECT_FAILED_ME2ME),
kelvinp 2015/02/23 21:17:51 Better handle test flakiness on IT2Me tests. This
+ browserTest.onUIMode(AppMode.CLIENT_CONNECT_FAILED_IT2ME)]);
onConnected = onConnected.then(function() {
return Promise.reject(
@@ -313,7 +317,7 @@ browserTest.expectConnected = function() {
* @param {base.EventSource} eventSource
* @param {string} event
* @param {number} timeoutMs
- * @param {?string} opt_expectedData
+ * @param {*=} opt_expectedData
* @return {Promise}
*/
browserTest.expectEvent = function(eventSource, event, timeoutMs,
@@ -383,7 +387,7 @@ browserTest.setupPIN = function(newPin) {
};
/**
- * @return {Promise}
+ * @return {Promise<boolean>}
*/
browserTest.isLocalHostStarted = function() {
return new Promise(function(resolve) {
« no previous file with comments | « no previous file | testing/chromoting/browser_test_commands_linux.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698