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

Unified Diff: remoting/webapp/browser_test/it2me_browser_test.js

Issue 927373005: [Chromoting] Enable jscompile for browser tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix unittests; More review comments Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: remoting/webapp/browser_test/it2me_browser_test.js
diff --git a/remoting/webapp/browser_test/it2me_browser_test.js b/remoting/webapp/browser_test/it2me_browser_test.js
index 0f5e7bc9063375bee7714961ed444d47725b745f..c3be9bc726c84314e92ced599b62b69e78a128d6 100644
--- a/remoting/webapp/browser_test/it2me_browser_test.js
+++ b/remoting/webapp/browser_test/it2me_browser_test.js
@@ -17,6 +17,9 @@
/** @constructor */
browserTest.ConnectIt2Me = function() {};
+/**
+ * @param {{pin: string, accessCode: string}} data
+ */
browserTest.ConnectIt2Me.prototype.run = function(data) {
browserTest.expect(typeof data.accessCode == 'string',
'The access code should be an non-empty string');
@@ -28,17 +31,23 @@ browserTest.ConnectIt2Me.prototype.run = function(data) {
return browserTest.disconnect();
}).then(function() {
browserTest.pass();
+ /** @param {*} reason */
}, function(reason) {
browserTest.fail(reason);
});
};
+/** @return {Promise} */
browserTest.ConnectIt2Me.clickOnAccessButton = function() {
browserTest.clickOnControl('access-mode-button');
return browserTest.onUIMode(remoting.AppMode.CLIENT_UNCONNECTED);
};
-/** @private */
+/**
+ * @param {string} code
+ * @return {Promise}
+ * @private
+ */
browserTest.ConnectIt2Me.prototype.enterAccessCode_ = function(code) {
document.getElementById('access-code-entry').value = code;
browserTest.clickOnControl('connect-button');
@@ -48,6 +57,9 @@ browserTest.ConnectIt2Me.prototype.enterAccessCode_ = function(code) {
/** @constructor */
browserTest.InvalidAccessCode = function() {};
+/**
+ * @param {{pin: string, accessCode: string}} data
+ */
browserTest.InvalidAccessCode.prototype.run = function(data) {
browserTest.expect(typeof data.accessCode == 'string',
'The access code should be an non-empty string');
@@ -55,7 +67,8 @@ browserTest.InvalidAccessCode.prototype.run = function(data) {
document.getElementById('access-code-entry').value = data.accessCode;
browserTest.clickOnControl('connect-button');
return browserTest.expectConnectionError(
- remoting.ClientSession.Mode.IT2ME, remoting.Error.INVALID_ACCESS_CODE);
+ remoting.DesktopConnectedView.Mode.IT2ME,
+ remoting.Error.INVALID_ACCESS_CODE);
}).then(function() {
browserTest.pass();
}, function(reason) {
@@ -86,11 +99,15 @@ browserTest.GetAccessCode.prototype.run = function() {
});
};
-// Wait for the email address of the local user to become available. The email
-// address is required in an It2Me connection for domain policy enforcement.
-// TODO:(kelvinp) Fix this awkward behavior in the production code so that this
-// hack is no longer required.
-/** @private */
+/**
+ * Wait for the email address of the local user to become available. The email
+ * address is required in an It2Me connection for domain policy enforcement.
+ * TODO:(kelvinp) Fix this awkward behavior in the production code so that this
+ * hack is no longer required.
+ *
+ * @return {Promise}
+ * @private
+ */
browserTest.GetAccessCode.prototype.onUserInfoReady_ = function() {
return new Promise(function(resolve, reject){
remoting.identity.getUserInfo(resolve, reject);
« no previous file with comments | « remoting/webapp/browser_test/invalid_pin_browser_test.js ('k') | remoting/webapp/browser_test/mock_client_plugin.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698