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

Side by Side Diff: remoting/webapp/browser_test/browser_test.js

Issue 1082383002: [Webapp Refactor] Remove remoting.clientSession. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix browser tests Created 5 years, 8 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 unified diff | Download patch
« no previous file with comments | « remoting/webapp/base/js/application.js ('k') | remoting/webapp/crd/js/activity.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 */ 215 */
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.app.getConnectionMode() === remoting.Application.Mode.IT2ME) { 220 if (remoting.app.getConnectionMode() === remoting.Application.Mode.IT2ME) {
221 finishedMode = AppMode.CLIENT_SESSION_FINISHED_IT2ME; 221 finishedMode = AppMode.CLIENT_SESSION_FINISHED_IT2ME;
222 finishedButton = 'client-finished-it2me-button'; 222 finishedButton = 'client-finished-it2me-button';
223 } 223 }
224 224
225 remoting.app.disconnect(); 225 var activity = remoting.app.getActivity();
226 if (!activity) {
227 return Promise.resolve();
228 }
229
230 activity.stop();
226 231
227 return browserTest.onUIMode(finishedMode).then(function() { 232 return browserTest.onUIMode(finishedMode).then(function() {
228 browserTest.clickOnControl(finishedButton); 233 browserTest.clickOnControl(finishedButton);
229 return browserTest.onUIMode(AppMode.HOME); 234 return browserTest.onUIMode(AppMode.HOME);
230 }); 235 });
231 }; 236 };
232 237
233 /** 238 /**
234 * @param {string} pin 239 * @param {string} pin
235 * @param {?boolean} opt_expectError 240 * @param {?boolean} opt_expectError
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 */ 434 */
430 browserTest.ensureRemoteConnectionEnabled = function(pin) { 435 browserTest.ensureRemoteConnectionEnabled = function(pin) {
431 browserTest.ensureHostStartedWithPIN(pin).then(function() { 436 browserTest.ensureHostStartedWithPIN(pin).then(function() {
432 browserTest.pass(); 437 browserTest.pass();
433 }, function(reason) { 438 }, function(reason) {
434 browserTest.fail(reason); 439 browserTest.fail(reason);
435 }); 440 });
436 }; 441 };
437 442
438 browserTest.init(); 443 browserTest.init();
OLDNEW
« no previous file with comments | « remoting/webapp/base/js/application.js ('k') | remoting/webapp/crd/js/activity.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698