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 * @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 Loading... | |
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() { | |
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'); | |
Jamie
2014/07/11 19:33:22
Rather than silently dismissing the dialog if it a
kelvinp
2014/07/11 21:11:22
Good question. Browser tests are configured in the
Jamie
2014/07/14 18:24:04
That was pretty much what I had in mind. I think y
| |
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 Loading... | |
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(); |
OLD | NEW |