| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * @fileoverview | 6 * @fileoverview |
| 7 * | 7 * |
| 8 * Provides basic functionality for JavaScript based browser test. | 8 * Provides basic functionality for JavaScript based browser test. |
| 9 * | 9 * |
| 10 * To define a browser test, create a class under the browserTest namespace. | 10 * To define a browser test, create a class under the browserTest namespace. |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 var CONNECT_PIN_WAIT = 500; | 242 var CONNECT_PIN_WAIT = 500; |
| 243 | 243 |
| 244 document.getElementById('pin-entry').value = pin; | 244 document.getElementById('pin-entry').value = pin; |
| 245 | 245 |
| 246 return base.Promise.sleep(CONNECT_PIN_WAIT).then(function() { | 246 return base.Promise.sleep(CONNECT_PIN_WAIT).then(function() { |
| 247 browserTest.clickOnControl('pin-connect-button'); | 247 browserTest.clickOnControl('pin-connect-button'); |
| 248 }).then(function() { | 248 }).then(function() { |
| 249 if (opt_expectError) { | 249 if (opt_expectError) { |
| 250 return browserTest.expectConnectionError( | 250 return browserTest.expectConnectionError( |
| 251 remoting.DesktopConnectedView.Mode.ME2ME, | 251 remoting.DesktopConnectedView.Mode.ME2ME, |
| 252 remoting.Error.INVALID_ACCESS_CODE); | 252 remoting.Error.Tag.INVALID_ACCESS_CODE); |
| 253 } else { | 253 } else { |
| 254 return browserTest.expectConnected(); | 254 return browserTest.expectConnected(); |
| 255 } | 255 } |
| 256 }); | 256 }); |
| 257 }; | 257 }; |
| 258 | 258 |
| 259 /** | 259 /** |
| 260 * @param {remoting.DesktopConnectedView.Mode} connectionMode | 260 * @param {remoting.DesktopConnectedView.Mode} connectionMode |
| 261 * @param {string} errorTag | 261 * @param {string} errorTag |
| 262 * @return {Promise} | 262 * @return {Promise} |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 428 */ | 428 */ |
| 429 browserTest.ensureRemoteConnectionEnabled = function(pin) { | 429 browserTest.ensureRemoteConnectionEnabled = function(pin) { |
| 430 browserTest.ensureHostStartedWithPIN(pin).then(function() { | 430 browserTest.ensureHostStartedWithPIN(pin).then(function() { |
| 431 browserTest.pass(); | 431 browserTest.pass(); |
| 432 }, function(reason) { | 432 }, function(reason) { |
| 433 browserTest.fail(reason); | 433 browserTest.fail(reason); |
| 434 }); | 434 }); |
| 435 }; | 435 }; |
| 436 | 436 |
| 437 browserTest.init(); | 437 browserTest.init(); |
| OLD | NEW |