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

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

Issue 896003002: Use the local user's email when connecting to It2MeHelpeeChannel (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@HRD_V2Auth
Patch Set: Fix unit test failure and rebase 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
« no previous file with comments | « remoting/webapp/crd/js/it2me_service.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/unittests/it2me_helpee_channel_unittest.js
diff --git a/remoting/webapp/unittests/it2me_helpee_channel_unittest.js b/remoting/webapp/unittests/it2me_helpee_channel_unittest.js
index 3a8cb9627b67d0fa9187aa1bea67363c91e3c639..9c66b49f9b47f10ed528943f0bfd12bae1e80825 100644
--- a/remoting/webapp/unittests/it2me_helpee_channel_unittest.js
+++ b/remoting/webapp/unittests/it2me_helpee_channel_unittest.js
@@ -47,6 +47,11 @@ module('It2MeHelpeeChannel', {
// remoting.settings
remoting.settings = new remoting.Settings();
+ remoting.identity = new remoting.Identity();
+ },
+ tearDown: function() {
+ remoting.settings = null;
+ remoting.identity = null;
}
});
@@ -112,19 +117,6 @@ test('downloadHost() should trigger a host download',
sinon.assert.called(hostInstaller.download);
});
-test('connect() should return error if email is missing',
- function() {
- var MessageTypes = remoting.It2MeHelpeeChannel.HangoutMessageTypes;
-
- hangoutPort.onMessage.mock$fire({
- method: MessageTypes.CONNECT
- });
-
- sinon.assert.calledWithMatch(hangoutPort.postMessage, {
- method: MessageTypes.ERROR
- });
-});
-
QUnit.asyncTest('connect() should return access code',
function() {
// Stubs authentication.
@@ -136,6 +128,10 @@ QUnit.asyncTest('connect() should return access code',
});
sinon.stub(chrome.identity, 'getAuthToken')
.callsArgWith(1, 'token');
+ sinon.stub(remoting.identity, 'callWithToken')
+ .callsArgWith(0, 'token');
+ sinon.stub(remoting.identity, 'getEmail')
+ .callsArgWith(0, {token: 'token', email: 'test@chromium.org'});
// Stubs Host behavior.
sinon.stub(host, 'initialized').returns(true);
sinon.stub(host, 'connect')
@@ -145,7 +141,6 @@ QUnit.asyncTest('connect() should return access code',
var MessageTypes = remoting.It2MeHelpeeChannel.HangoutMessageTypes;
hangoutPort.onMessage.mock$fire({
method: MessageTypes.CONNECT,
- email: 'test@chromium.org',
hangoutBounds: {widht: 10, height: 10, left:10, top: 10}
});
« no previous file with comments | « remoting/webapp/crd/js/it2me_service.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698