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

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

Issue 984203003: Move mocks and unittest JS files to sit alongside production code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/webapp/unittests/menu_button_unittest.js ('k') | remoting/webapp/unittests/xhr_unittest.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/unittests/mock_signal_strategy.js
diff --git a/remoting/webapp/unittests/mock_signal_strategy.js b/remoting/webapp/unittests/mock_signal_strategy.js
deleted file mode 100644
index 26fba1b768fa031f159c5d0bf8fc0e9152d06a3d..0000000000000000000000000000000000000000
--- a/remoting/webapp/unittests/mock_signal_strategy.js
+++ /dev/null
@@ -1,79 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-'use strict';
-
-/** @suppress {duplicate} */
-var remoting = remoting || {};
-
-
-/**
- * @param {string=} jid
- * @param {remoting.SignalStrategy.Type=} type
- *
- * @implements {remoting.SignalStrategy}
- * @constructor
- */
-remoting.MockSignalStrategy = function(jid, type) {
- this.jid_ = (jid != undefined) ? jid : "jid@example.com";
- this.type_ = (type != undefined) ? type : remoting.SignalStrategy.Type.XMPP;
- this.onStateChangedCallback_ = null;
-
- /** @type {remoting.SignalStrategy.State} */
- this.state_ = remoting.SignalStrategy.State.NOT_CONNECTED;
-
- this.onIncomingStanzaCallback_ = function() {};
- this.dispose = sinon.spy();
- this.connect = sinon.spy();
- this.sendMessage = sinon.spy();
- this.sendConnectionSetupResults = sinon.spy();
-};
-
-/**
- * @param {function(remoting.SignalStrategy.State):void} onStateChangedCallback
- * Callback to call on state change.
- */
-remoting.MockSignalStrategy.prototype.setStateChangedCallback = function(
- onStateChangedCallback) {
- this.onStateChangedCallback_ = onStateChangedCallback;
-};
-
-/**
- * @param {?function(Element):void} onIncomingStanzaCallback Callback to call on
- * incoming messages.
- */
-remoting.MockSignalStrategy.prototype.setIncomingStanzaCallback =
- function(onIncomingStanzaCallback) {
- this.onIncomingStanzaCallback_ =
- onIncomingStanzaCallback ? onIncomingStanzaCallback
- : function() {};
-};
-
-/** @return {remoting.SignalStrategy.State} */
-remoting.MockSignalStrategy.prototype.getState = function() {
- return this.state_;
-};
-
-/** @return {!remoting.Error} */
-remoting.MockSignalStrategy.prototype.getError = function() {
- return remoting.Error.NONE;
-};
-
-/** @return {string} */
-remoting.MockSignalStrategy.prototype.getJid = function() {
- return this.jid_;
-};
-
-/** @return {remoting.SignalStrategy.Type} */
-remoting.MockSignalStrategy.prototype.getType = function() {
- return this.type_;
-};
-
-/**
- * @param {remoting.SignalStrategy.State} state
- */
-remoting.MockSignalStrategy.prototype.setStateForTesting = function(state) {
- this.state_ = state;
- this.onStateChangedCallback_(state);
-};
« no previous file with comments | « remoting/webapp/unittests/menu_button_unittest.js ('k') | remoting/webapp/unittests/xhr_unittest.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698