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

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

Issue 473073002: Move hello message from It2MeService to It2MeChannel (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address CR feedback Created 6 years, 4 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/it2me_helper_channel_unittest.js
diff --git a/remoting/webapp/unittests/it2me_helper_channel_unittest.js b/remoting/webapp/unittests/it2me_helper_channel_unittest.js
index b5511c33058c9c9a0ef7d3ceb1aea7589e0561d1..b2f76c25cbb2115e93578fd715400b84ed840aaf 100644
--- a/remoting/webapp/unittests/it2me_helper_channel_unittest.js
+++ b/remoting/webapp/unittests/it2me_helper_channel_unittest.js
@@ -61,6 +61,17 @@ function promiseResolveSynchronous(value) {
};
}
+test('onHangoutMessage_("hello") should return supportedFeatures', function() {
+ hangoutPort.onMessage.mock$fire(
+ { method: remoting.It2MeHelperChannel.HangoutMessageTypes.HELLO });
+
+ var spyCall = hangoutPort.postMessage.firstCall;
+ var message = spyCall.args[0];
+
+ QUnit.equal(message.method, 'helloResponse');
Jamie 2014/08/15 21:57:31 remoting.It2MeHelperChannel.HangoutMessageTypes.HE
kelvinp 2014/08/15 23:25:01 Done.
+ QUnit.ok(message.supportedFeatures instanceof Array);
Jamie 2014/08/15 21:57:31 I think it might be worth checking that it's equal
kelvinp 2014/08/15 23:25:01 Done.
+});
+
test('onHangoutMessage_(|connect|) should launch the webapp',
function() {
sinon.assert.called(appLauncher.launch);
@@ -120,6 +131,12 @@ test('should notify hangout when the session is ended', function() {
method:'sessionStateChanged',
state:remoting.ClientSession.State.CLOSED
});
+
+ sinon.assert.neverCalledWith(hangoutPort.postMessage, {
+ method:'sessionStateChanged',
+ state:remoting.ClientSession.State.FAILED
+ });
Jamie 2014/08/15 21:57:32 Is this related to this CL?
kelvinp 2014/08/15 23:25:01 Done.
+
sinon.assert.called(hangoutPort.disconnect);
sinon.assert.calledOnce(disconnectCallback);
});

Powered by Google App Engine
This is Rietveld 408576698