summaryrefslogtreecommitdiffstats
path: root/remoting/webapp/browser_test/mock_signal_strategy.js
diff options
context:
space:
mode:
authorjamiewalch <jamiewalch@chromium.org>2014-09-24 19:10:10 -0700
committerCommit bot <commit-bot@chromium.org>2014-09-25 02:10:29 +0000
commit8e0666d30aeb18d0672ca7ab6a9867ee97da159b (patch)
tree7809c8a2263a23daf1dc7543839d6b9d9085a3fb /remoting/webapp/browser_test/mock_signal_strategy.js
parent32977338f1cd4b588d4244e49860f35bdda7c3a6 (diff)
downloadchromium_src-8e0666d30aeb18d0672ca7ab6a9867ee97da159b.zip
chromium_src-8e0666d30aeb18d0672ca7ab6a9867ee97da159b.tar.gz
chromium_src-8e0666d30aeb18d0672ca7ab6a9867ee97da159b.tar.bz2
Implement basic mocks for testing.
These may need to be made more elaborate once we start using them in browser tests, but I've verified that they can be used to mock a basic connection with resize support. Review URL: https://codereview.chromium.org/593313003 Cr-Commit-Position: refs/heads/master@{#296624}
Diffstat (limited to 'remoting/webapp/browser_test/mock_signal_strategy.js')
-rw-r--r--remoting/webapp/browser_test/mock_signal_strategy.js41
1 files changed, 41 insertions, 0 deletions
diff --git a/remoting/webapp/browser_test/mock_signal_strategy.js b/remoting/webapp/browser_test/mock_signal_strategy.js
new file mode 100644
index 0000000..2c19b36
--- /dev/null
+++ b/remoting/webapp/browser_test/mock_signal_strategy.js
@@ -0,0 +1,41 @@
+// Copyright 2014 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.
+
+/**
+ * @fileoverview
+ * @suppress {checkTypes}
+ */
+
+'use strict';
+
+/** @suppress {duplicate} */
+var remoting = remoting || {};
+
+/**
+ * @constructor
+ * @implements {remoting.SignalStrategy}
+ */
+remoting.MockSignalStrategy = function() {};
+
+remoting.MockSignalStrategy.prototype.dispose = function() {};
+
+remoting.MockSignalStrategy.prototype.setIncomingStanzaCallback =
+ function(onIncomingStanzaCallback) {};
+
+remoting.MockSignalStrategy.prototype.connect =
+ function(server, username, authToken) {};
+
+remoting.MockSignalStrategy.prototype.sendMessage = function(message) {};
+
+remoting.MockSignalStrategy.prototype.getState = function() {
+ return remoting.SignalStrategy.State.CONNECTED;
+};
+
+remoting.MockSignalStrategy.prototype.getError = function() {
+ return remoting.Error.NONE;
+};
+
+remoting.MockSignalStrategy.prototype.getJid = function() {
+ return '';
+};