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

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

Issue 389673003: Handle host need upgrade in Pin browser test (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address Jamie's feedbacks Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | remoting/webapp/browser_test/cancel_pin_browser_test.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 * @suppress {checkTypes} By default, JSCompile is not run on test files. 7 * @suppress {checkTypes} By default, JSCompile is not run on test files.
8 * However, you can modify |remoting_webapp_files.gypi| locally to include 8 * However, you can modify |remoting_webapp_files.gypi| locally to include
9 * the test in the package to expedite local development. This suppress 9 * the test in the package to expedite local development. This suppress
10 * is here so that JSCompile won't complain. 10 * is here so that JSCompile won't complain.
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 } 149 }
150 } 150 }
151 151
152 if (opt_timeout != browserTest.Timeout.NONE) { 152 if (opt_timeout != browserTest.Timeout.NONE) {
153 timerId = window.setTimeout(onTimeout, opt_timeout); 153 timerId = window.setTimeout(onTimeout, opt_timeout);
154 } 154 }
155 remoting.testEvents.addEventListener(uiModeChanged, onUIModeChanged); 155 remoting.testEvents.addEventListener(uiModeChanged, onUIModeChanged);
156 }); 156 });
157 }; 157 };
158 158
159 browserTest.connectMe2Me = function() {
garykac 2014/07/11 23:25:39 connectMe2Me doesn't feel like the right name for
160 var AppMode = remoting.AppMode;
161 browserTest.clickOnControl('this-host-connect');
162 return browserTest.onUIMode(AppMode.CLIENT_HOST_NEEDS_UPGRADE).then(
163 function() {
164 // On fulfilled.
165 browserTest.clickOnControl('host-needs-update-connect-button');
166 }, function() {
167 // On time out.
168 return Promise.resolve();
169 }).then(function() {
170 return browserTest.onUIMode(AppMode.CLIENT_PIN_PROMPT);
171 });
172 }
173
159 browserTest.expectMe2MeError = function(errorTag) { 174 browserTest.expectMe2MeError = function(errorTag) {
160 var AppMode = remoting.AppMode; 175 var AppMode = remoting.AppMode;
161 var Timeout = browserTest.Timeout; 176 var Timeout = browserTest.Timeout;
162 177
163 var onConnected = browserTest.onUIMode(AppMode.IN_SESSION, Timeout.None); 178 var onConnected = browserTest.onUIMode(AppMode.IN_SESSION, Timeout.None);
164 var onFailure = browserTest.onUIMode(AppMode.CLIENT_CONNECT_FAILED_ME2ME); 179 var onFailure = browserTest.onUIMode(AppMode.CLIENT_CONNECT_FAILED_ME2ME);
165 180
166 onConnected = onConnected.then(function() { 181 onConnected = onConnected.then(function() {
167 return Promise.reject( 182 return Promise.reject(
168 'Expected the Me2Me connection to fail.'); 183 'Expected the Me2Me connection to fail.');
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 try { 219 try {
205 var test = new testClass(); 220 var test = new testClass();
206 browserTest.expect(typeof test.run == 'function'); 221 browserTest.expect(typeof test.run == 'function');
207 test.run(data); 222 test.run(data);
208 } catch (e) { 223 } catch (e) {
209 browserTest.fail(e); 224 browserTest.fail(e);
210 } 225 }
211 }; 226 };
212 227
213 browserTest.init(); 228 browserTest.init();
OLDNEW
« no previous file with comments | « no previous file | remoting/webapp/browser_test/cancel_pin_browser_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698