| 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 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 var CONNECT_PIN_WAIT = 500; | 239 var CONNECT_PIN_WAIT = 500; |
| 240 | 240 |
| 241 document.getElementById('pin-entry').value = pin; | 241 document.getElementById('pin-entry').value = pin; |
| 242 | 242 |
| 243 return base.Promise.sleep(CONNECT_PIN_WAIT).then(function() { | 243 return base.Promise.sleep(CONNECT_PIN_WAIT).then(function() { |
| 244 browserTest.clickOnControl('pin-connect-button'); | 244 browserTest.clickOnControl('pin-connect-button'); |
| 245 }).then(function() { | 245 }).then(function() { |
| 246 if (opt_expectError) { | 246 if (opt_expectError) { |
| 247 return browserTest.expectConnectionError( | 247 return browserTest.expectConnectionError( |
| 248 remoting.DesktopConnectedView.Mode.ME2ME, | 248 remoting.DesktopConnectedView.Mode.ME2ME, |
| 249 remoting.Error.INVALID_ACCESS_CODE); | 249 remoting.Error.Tag.INVALID_ACCESS_CODE); |
| 250 } else { | 250 } else { |
| 251 return browserTest.expectConnected(); | 251 return browserTest.expectConnected(); |
| 252 } | 252 } |
| 253 }); | 253 }); |
| 254 }; | 254 }; |
| 255 | 255 |
| 256 /** | 256 /** |
| 257 * @param {remoting.DesktopConnectedView.Mode} connectionMode | 257 * @param {remoting.DesktopConnectedView.Mode} connectionMode |
| 258 * @param {string} errorTag | 258 * @param {string} errorTag |
| 259 * @return {Promise} | 259 * @return {Promise} |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 425 */ | 425 */ |
| 426 browserTest.ensureRemoteConnectionEnabled = function(pin) { | 426 browserTest.ensureRemoteConnectionEnabled = function(pin) { |
| 427 browserTest.ensureHostStartedWithPIN(pin).then(function() { | 427 browserTest.ensureHostStartedWithPIN(pin).then(function() { |
| 428 browserTest.pass(); | 428 browserTest.pass(); |
| 429 }, function(reason) { | 429 }, function(reason) { |
| 430 browserTest.fail(reason); | 430 browserTest.fail(reason); |
| 431 }); | 431 }); |
| 432 }; | 432 }; |
| 433 | 433 |
| 434 browserTest.init(); | 434 browserTest.init(); |
| OLD | NEW |