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

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

Issue 273753002: Implement 3 PIN browser tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address CR feedbacks 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. Enter |data.pin| at the PIN prompt.
11 * 3. Verify that there is connection error due to invalid access code.
12 */
13
14 'use strict';
15
16 /** @constructor */
17 browserTest.Invalid_PIN = function() {};
18
19 browserTest.Invalid_PIN.prototype.run = function(data) {
20 // Input validation.
21 browserTest.expect(typeof data.pin == 'string');
22
23 browserTest.onUIMode(remoting.AppMode.CLIENT_PIN_PROMPT).then(
24 this.enterPIN_.bind(this, data.pin)
25 ).then(
26 // Sleep for two seconds to allow the host backoff timer to reset.
27 base.Promise.sleep.bind(window, 2000)
28 ).then(function() {
29 // On fulfilled.
30 browserTest.pass();
31 }, function(reason) {
32 // On rejected.
33 browserTest.fail(reason);
34 });
35
36 // Connect to me2me Host.
37 browserTest.clickOnControl('this-host-connect');
38 };
39
40 browserTest.Invalid_PIN.prototype.enterPIN_ = function(pin) {
41 var InvalidPINError = remoting.Error.INVALID_ACCESS_CODE;
42 var promise = browserTest.expectMe2MeError(InvalidPINError);
43
44 document.getElementById('pin-entry').value = pin;
45 browserTest.clickOnControl('pin-connect-button');
46
47 return promise;
48 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698