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

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

Issue 1007543003: Implements It2MeBrowserTest CancelShare and VerifyAccessCodeNotReusable (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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
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 * Browser test for the scenario below: 7 * Browser test for the scenario below:
8 * 1. Generates an access code. 8 * 1. Generates an access code.
9 * 2. Launches another chromoting app instance. 9 * 2. Launches another chromoting app instance.
10 * 3. Connects with the generated access code. 10 * 3. Connects with the generated access code.
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 return browserTest.onUIMode(remoting.AppMode.HOST_WAITING_FOR_CONNECTION); 90 return browserTest.onUIMode(remoting.AppMode.HOST_WAITING_FOR_CONNECTION);
91 }).then(function() { 91 }).then(function() {
92 var accessCode = document.getElementById('access-code-display').innerText; 92 var accessCode = document.getElementById('access-code-display').innerText;
93 var numericAccessCode = parseFloat(accessCode); 93 var numericAccessCode = parseFloat(accessCode);
94 browserTest.expect(accessCode.length === 12, 94 browserTest.expect(accessCode.length === 12,
95 "The access code should be 12 digits long."); 95 "The access code should be 12 digits long.");
96 browserTest.expect( 96 browserTest.expect(
97 Number.isInteger(numericAccessCode) && numericAccessCode > 0, 97 Number.isInteger(numericAccessCode) && numericAccessCode > 0,
98 "The access code should be a positive integer."); 98 "The access code should be a positive integer.");
99 browserTest.pass(); 99 browserTest.pass();
100 }, function(/** * */reason) { 100 }).catch(function(/** Error */ reason) {
101 browserTest.fail(/** @type {Error} */(reason)); 101 browserTest.fail(reason);
102 }); 102 });
103 }; 103 };
104
105 /** @constructor */
106 browserTest.CancelShare = function() {};
107
108 browserTest.CancelShare.prototype.run = function() {
109 browserTest.clickOnControl('cancel-share-button');
110 browserTest.onUIMode(remoting.AppMode.HOST_SHARE_FINISHED).then(function() {
111 browserTest.pass();
112 }).catch(function(/** Error */ reason) {
113 browserTest.fail(reason);
114 });
115 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698