summaryrefslogtreecommitdiffstats
path: root/remoting/webapp/unittests
diff options
context:
space:
mode:
authorsergeyu <sergeyu@chromium.org>2014-09-03 23:37:18 -0700
committerCommit bot <commit-bot@chromium.org>2014-09-04 06:41:33 +0000
commit30975b8951c8c131883b0da0944b130fc8d1f2ae (patch)
tree462898a8b433b69360acdaa7ac085994a9bb959d /remoting/webapp/unittests
parente752fba625ff3d4f53726dd4bc1eb0a9c92e3c89 (diff)
downloadchromium_src-30975b8951c8c131883b0da0944b130fc8d1f2ae.zip
chromium_src-30975b8951c8c131883b0da0944b130fc8d1f2ae.tar.gz
chromium_src-30975b8951c8c131883b0da0944b130fc8d1f2ae.tar.bz2
Use XMPP in V2 webapp
After this change the webapp will be use XMPP for signaling instead of WCS. BUG=274652 Review URL: https://codereview.chromium.org/530213004 Cr-Commit-Position: refs/heads/master@{#293273}
Diffstat (limited to 'remoting/webapp/unittests')
-rw-r--r--remoting/webapp/unittests/xmpp_connection_unittest.js11
1 files changed, 6 insertions, 5 deletions
diff --git a/remoting/webapp/unittests/xmpp_connection_unittest.js b/remoting/webapp/unittests/xmpp_connection_unittest.js
index 59feff2..4f33fa5 100644
--- a/remoting/webapp/unittests/xmpp_connection_unittest.js
+++ b/remoting/webapp/unittests/xmpp_connection_unittest.js
@@ -29,7 +29,8 @@ module('XmppConnection', {
sinon.stub(chrome.socket, 'destroy');
sinon.stub(chrome.socket, 'secure');
- connection = new remoting.XmppConnection(onStateChange, onStanza);
+ connection = new remoting.XmppConnection(onStateChange);
+ connection.setIncomingStanzaCallback(onStanza);
},
teardown: function() {
@@ -46,7 +47,7 @@ test('should go to FAILED state when failed to connect', function() {
connection.connect(
'xmpp.example.com:123', 'testUsername@gmail.com', 'testToken');
sinon.assert.calledWith(onStateChange,
- remoting.XmppConnection.State.CONNECTING);
+ remoting.SignalStrategy.State.CONNECTING);
sinon.assert.calledWith(chrome.socket.create, "tcp", {});
chrome.socket.create.getCall(0).args[2]({socketId: socketId});
@@ -62,7 +63,7 @@ test('should use XmppLoginHandler to complete handshake and read data',
connection.connect(
'xmpp.example.com:123', 'testUsername@gmail.com', 'testToken');
sinon.assert.calledWith(onStateChange,
- remoting.XmppConnection.State.CONNECTING);
+ remoting.SignalStrategy.State.CONNECTING);
sinon.assert.calledWith(chrome.socket.create, "tcp", {});
chrome.socket.create.getCall(0).args[2]({socketId: socketId});
@@ -71,7 +72,7 @@ test('should use XmppLoginHandler to complete handshake and read data',
chrome.socket.connect.getCall(0).args[3](0);
sinon.assert.calledWith(onStateChange,
- remoting.XmppConnection.State.HANDSHAKE);
+ remoting.SignalStrategy.State.HANDSHAKE);
var parser = new remoting.XmppStreamParser();
var parserMock = sinon.mock(parser);
@@ -79,7 +80,7 @@ test('should use XmppLoginHandler to complete handshake and read data',
connection.loginHandler_.onHandshakeDoneCallback_('test@example.com/123123',
parser);
sinon.assert.calledWith(onStateChange,
- remoting.XmppConnection.State.CONNECTED);
+ remoting.SignalStrategy.State.CONNECTED);
setCallbacksCalled.verify();
// Simulate read() callback with |data|. It should be passed to the parser.