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

Unified Diff: remoting/webapp/unittests/fallback_signal_strategy_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/fallback_signal_strategy_unittest.js
diff --git a/remoting/webapp/unittests/fallback_signal_strategy_unittest.js b/remoting/webapp/unittests/fallback_signal_strategy_unittest.js
index 959902ba038fb4ca03b3a43943cefc3e2aa21573..8fecc9cabe51e54e2ca13ea817640e713666ce9d 100644
--- a/remoting/webapp/unittests/fallback_signal_strategy_unittest.js
+++ b/remoting/webapp/unittests/fallback_signal_strategy_unittest.js
@@ -2,15 +2,23 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+/**
+ * @fileoverview
+ * TODO(garykac): Create interfaces for LogToServer and SignalStrategy.
+ * @suppress {checkTypes|checkVars|reportUnknownTypes|visibility}
+ */
+
(function() {
'use strict';
-
+/** @constructor */
var MockLogToServer = function() {
+ /** @type {(sinon.$spy|Function)} */
this.logSignalStrategyProgress = sinon.spy();
};
+/** @type {function(...)} */
MockLogToServer.prototype.assertProgress = function() {
equal(this.logSignalStrategyProgress.callCount * 2, arguments.length);
for (var i = 0; i < this.logSignalStrategyProgress.callCount; ++i) {
@@ -20,13 +28,29 @@ MockLogToServer.prototype.assertProgress = function() {
}
};
+/** @type {(sinon.$spy|function(remoting.SignalStrategy.State))} */
var onStateChange = null;
+
+/** @type {(sinon.$spy|function(Element):void)} */
var onIncomingStanzaCallback = null;
+
+/** @type {remoting.FallbackSignalStrategy} */
var strategy = null;
+
+/** @type {remoting.SignalStrategy} */
var primary = null;
+
+/** @type {remoting.SignalStrategy} */
var secondary = null;
+
+/** @type {MockLogToServer} */
var logToServer = null;
+/**
+ * @param {remoting.MockSignalStrategy} baseSignalStrategy
+ * @param {remoting.SignalStrategy.State} state
+ * @param {boolean} expectCallback
+ */
function setState(baseSignalStrategy, state, expectCallback) {
onStateChange.reset();
baseSignalStrategy.setStateForTesting(state);

Powered by Google App Engine
This is Rietveld 408576698