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

Unified Diff: remoting/webapp/unittests/xmpp_login_handler_unittest.js

Issue 959963002: [Chromoting] Enable jscompile for webapp unittests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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/unittests/xmpp_login_handler_unittest.js
diff --git a/remoting/webapp/unittests/xmpp_login_handler_unittest.js b/remoting/webapp/unittests/xmpp_login_handler_unittest.js
index 2b1adfd00831c3aa29a9829b08afaf6b4e48ec3b..281cd50bcf73d063b824edc93b54922d82f25a57 100644
--- a/remoting/webapp/unittests/xmpp_login_handler_unittest.js
+++ b/remoting/webapp/unittests/xmpp_login_handler_unittest.js
@@ -9,11 +9,19 @@
var testUsername = 'testUsername@gmail.com';
var testToken = 'testToken';
-var sendMessage = null;
-var startTls = null;
-var onHandshakeDone = null;
-var onStanzaStr = null;
-var onError = null;
+/** @type {(sinon.$spy|function(string):void)} */
+var sendMessage = function(msg) {};
+
+/** @type {(sinon.$spy|function():void)} */
+var startTls = function() {};
+
+/** @type {(sinon.$spy|function(string, remoting.XmppStreamParser):void)} */
+var onHandshakeDone = function(name, parser) {};
+
+/** @type {(sinon.$spy|function(remoting.Error, string):void)} */
+var onError = function(error, message) {};
+
+/** @type {remoting.XmppLoginHandler} */
var loginHandler = null;
module('XmppLoginHandler', {
@@ -22,9 +30,14 @@ module('XmppLoginHandler', {
startTls = sinon.spy();
onHandshakeDone = sinon.spy();
onError = sinon.spy();
+
loginHandler = new remoting.XmppLoginHandler(
- 'google.com', testUsername, testToken, false, sendMessage,
- startTls, onHandshakeDone, onError);
+ 'google.com', testUsername, testToken, false,
+ /** @type {function(string):void} */ (sendMessage),
+ /** @type {function():void} */ (startTls),
+ /** @type {function(string, remoting.XmppStreamParser):void} */
+ (onHandshakeDone),
+ /** @type {function(remoting.Error, string):void} */ (onError));
}
});

Powered by Google App Engine
This is Rietveld 408576698