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

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

Issue 273753002: Implement 3 PIN browser tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Last iteration Created 6 years, 7 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 /**
6 * @fileoverview
7 * @suppress {checkTypes}
8 * Browser test for the scenario below:
9 * 1. Attempt to connect.
10 * 2. Hit cancel at the PIN prompt.
11 * 3. Reconnect with the PIN.
12 * 4. Verify that the session is connected.
13 */
14
15 'use strict';
16
17 /** @constructor */
18 browserTest.Cancel_PIN = function() {};
19
20 browserTest.Cancel_PIN.prototype.run = function(data) {
21 browserTest.expect(typeof data.pin == 'string');
22
23 var AppMode = remoting.AppMode;
24 browserTest.clickOnControl('this-host-connect');
25 browserTest.onUIMode(AppMode.CLIENT_PIN_PROMPT).then(function() {
26 browserTest.clickOnControl('cancel-pin-entry-button');
27 return browserTest.onUIMode(AppMode.HOME);
28 }).then(function() {
29 browserTest.clickOnControl('this-host-connect');
30 return browserTest.onUIMode(AppMode.CLIENT_PIN_PROMPT);
31 }).then(
32 this.enterPin_.bind(this, data.pin)
33 ).then(function() {
34 // On fulfilled.
35 browserTest.pass();
36 }, function(reason) {
37 // On rejected.
38 browserTest.fail(reason);
39 });
40 };
41
42 browserTest.Cancel_PIN.prototype.enterPin_ = function(pin) {
43 document.getElementById('pin-entry').value = pin;
44 browserTest.clickOnControl('pin-connect-button');
45 return browserTest.expectMe2MeConnected();
46 };
OLDNEW
« no previous file with comments | « remoting/webapp/browser_test/browser_test.js ('k') | remoting/webapp/browser_test/invalid_pin_browser_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698