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

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

Issue 973333002: Remove Hangout Remote Desktop integration code from the webapp. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase + manifest changes 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/unittests/it2me_helper_channel_unittest.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_service_unittest.js
diff --git a/remoting/webapp/unittests/it2me_service_unittest.js b/remoting/webapp/unittests/it2me_service_unittest.js
deleted file mode 100644
index a9a71b0bcc73038385090a09cd49133dfab75153..0000000000000000000000000000000000000000
--- a/remoting/webapp/unittests/it2me_service_unittest.js
+++ /dev/null
@@ -1,137 +0,0 @@
-// 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|checkVars|reportUnknownTypes|visibility}
- */
-
-(function() {
-
-'use strict';
-
-var appLauncher = null;
-var hangoutPort = null;
-var webappPort = null;
-var it2meService = null;
-
-function createPort(name, senderId) {
- var port = new chromeMocks.runtime.Port();
- port.name = (senderId) ? name +'@' + senderId : name;
- port.postMessage = sinon.spy(port, 'postMessage');
- port.disconnect = sinon.spy(port, 'disconnect');
-
- return port;
-}
-
-function promiseResolveSynchronous(value) {
- return {
- then: function(callback) {
- callback(value);
- }
- };
-}
-
-module('It2MeService', {
- setup: function() {
- // App Launcher.
- appLauncher = {
- launch: function () {
- return promiseResolveSynchronous('tabId');
- },
- close: function () {}
- };
- // HangoutPort.
- hangoutPort = createPort('it2me.helper.hangout');
- it2meService = new remoting.It2MeService(appLauncher);
- it2meService.onConnectExternal_(hangoutPort);
- webappPort = createPort('it2me.helper.webapp', 'tabId');
- }
-});
-
-test('should establish a channel two way channel when the webapp connects',
- function() {
- // Hangout ---- connect ----> It2MeService.
- hangoutPort.onMessage.mock$fire({
- method: 'connect',
- accessCode: "123412341234"
- });
-
- // Webapp ---- connect ----> It2MeService.
- it2meService.onWebappConnect_(webappPort);
-
- // Webapp ---- sessionStateChanged ----> It2MeService.
- webappPort.onMessage.mock$fire({
- method: 'sessionStateChanged',
- state: remoting.ClientSession.State.CONNECTED
- });
-
- // verify that hangout can receive message events.
- sinon.assert.calledWith(hangoutPort.postMessage, {
- method: 'sessionStateChanged',
- state: remoting.ClientSession.State.CONNECTED
- });
-
- hangoutPort.onDisconnect.mock$fire();
- QUnit.equal(it2meService.helpers_.length, 0);
-});
-
-test('should handle multiple helper connections', function() {
- // Hangout ---- connect ----> It2MeService.
- hangoutPort.onMessage.mock$fire({
- method: 'connect',
- accessCode: "123412341234"
- });
-
- // Hangout2 ---- connect ----> It2MeService.
- var hangoutPort2 = createPort('it2me.helper.hangout');
- it2meService.onConnectExternal_(hangoutPort2);
-
- appLauncher.launch = function () {
- return promiseResolveSynchronous('tabId2');
- };
-
- hangoutPort2.onMessage.mock$fire({
- method: 'connect',
- accessCode: "123412341234"
- });
-
- it2meService.onWebappConnect_(webappPort);
-
- var webappPort2 = createPort('it2me.helper.webapp', 'tabId2');
- it2meService.onWebappConnect_(webappPort2);
-
- webappPort.onMessage.mock$fire({
- method: 'sessionStateChanged',
- state: remoting.ClientSession.State.CONNECTED
- });
-
- // verify that hangout can receive message events from webapp 1
- sinon.assert.calledWith(hangoutPort.postMessage, {
- method: 'sessionStateChanged',
- state: remoting.ClientSession.State.CONNECTED
- });
-
- webappPort2.onMessage.mock$fire({
- method: 'sessionStateChanged',
- state: remoting.ClientSession.State.CLOSED
- });
-
- // verify that hangout can receive message events from webapp 2.
- sinon.assert.calledWith(hangoutPort2.postMessage, {
- method: 'sessionStateChanged',
- state: remoting.ClientSession.State.CLOSED
- });
-});
-
-test('should reject unknown connection', function() {
- it2meService.onWebappConnect_(webappPort);
- sinon.assert.called(webappPort.disconnect);
-
- var randomPort = createPort('unsupported.port.name');
- it2meService.onConnectExternal_(randomPort);
- sinon.assert.called(randomPort.disconnect);
-});
-
-})();
« no previous file with comments | « remoting/webapp/unittests/it2me_helper_channel_unittest.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698