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 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 browserTest.disconnect = function() { | 216 browserTest.disconnect = function() { |
217 var AppMode = remoting.AppMode; | 217 var AppMode = remoting.AppMode; |
218 var finishedMode = AppMode.CLIENT_SESSION_FINISHED_ME2ME; | 218 var finishedMode = AppMode.CLIENT_SESSION_FINISHED_ME2ME; |
219 var finishedButton = 'client-finished-me2me-button'; | 219 var finishedButton = 'client-finished-me2me-button'; |
220 if (remoting.desktopConnectedView.getMode() == | 220 if (remoting.desktopConnectedView.getMode() == |
221 remoting.DesktopConnectedView.Mode.IT2ME) { | 221 remoting.DesktopConnectedView.Mode.IT2ME) { |
222 finishedMode = AppMode.CLIENT_SESSION_FINISHED_IT2ME; | 222 finishedMode = AppMode.CLIENT_SESSION_FINISHED_IT2ME; |
223 finishedButton = 'client-finished-it2me-button'; | 223 finishedButton = 'client-finished-it2me-button'; |
224 } | 224 } |
225 | 225 |
226 remoting.disconnect(); | 226 remoting.app.disconnect(); |
227 | 227 |
228 return browserTest.onUIMode(finishedMode).then(function() { | 228 return browserTest.onUIMode(finishedMode).then(function() { |
229 browserTest.clickOnControl(finishedButton); | 229 browserTest.clickOnControl(finishedButton); |
230 return browserTest.onUIMode(AppMode.HOME); | 230 return browserTest.onUIMode(AppMode.HOME); |
231 }); | 231 }); |
232 }; | 232 }; |
233 | 233 |
234 /** | 234 /** |
235 * @param {string} pin | 235 * @param {string} pin |
236 * @param {?boolean} opt_expectError | 236 * @param {?boolean} opt_expectError |
(...skipping 191 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 |