Roll src/third_party/WebKit d9c6159:8139f33 (svn 201974:201975)
[chromium-blink-merge.git] / remoting / webapp / browser_test / cancel_pin_browser_test.js
blob888ea069b60d67f431c130b459734da379a3d453
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.
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.
15 'use strict';
17 /** @constructor */
18 browserTest.Cancel_PIN = function() {};
20 /**
21 * @param {{pin:string}} data
23 browserTest.Cancel_PIN.prototype.run = function(data) {
24 browserTest.expect(typeof data.pin == 'string');
26 var AppMode = remoting.AppMode;
27 browserTest.connectMe2Me().then(function() {
28 browserTest.clickOnControl('#pin-dialog .cancel-button');
29 return browserTest.onUIMode(AppMode.HOME);
30 }).then(function() {
31 return browserTest.connectMe2Me()
32 }).then(function() {
33 return browserTest.enterPIN(data.pin)
34 }).then(function() {
35 // On fulfilled.
36 browserTest.pass();
37 }, function(reason) {
38 // On rejected.
39 browserTest.fail(reason);
40 });