| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * @fileoverview | 6 * @fileoverview |
| 7 * Mock implementation of ClientPlugin for testing. | 7 * Mock implementation of ClientPlugin for testing. |
| 8 * @suppress {checkTypes} | 8 * @suppress {checkTypes} |
| 9 */ | 9 */ |
| 10 | 10 |
| 11 'use strict'; | 11 'use strict'; |
| 12 | 12 |
| 13 /** @suppress {duplicate} */ | 13 /** @suppress {duplicate} */ |
| 14 var remoting = remoting || {}; | 14 var remoting = remoting || {}; |
| 15 | 15 |
| 16 /** | 16 /** |
| 17 * @param {Element} container |
| 17 * @constructor | 18 * @constructor |
| 18 * @implements {remoting.ClientPlugin} | 19 * @implements {remoting.ClientPlugin} |
| 19 */ | 20 */ |
| 20 remoting.MockClientPlugin = function(container) { | 21 remoting.MockClientPlugin = function(container) { |
| 21 this.container_ = container; | 22 this.container_ = container; |
| 22 this.element_ = document.createElement('div'); | 23 this.element_ = document.createElement('div'); |
| 23 this.element_.style.backgroundImage = 'linear-gradient(45deg, blue, red)'; | 24 this.element_.style.backgroundImage = 'linear-gradient(45deg, blue, red)'; |
| 24 this.width_ = 640; | 25 this.width_ = 640; |
| 25 this.height_ = 480; | 26 this.height_ = 480; |
| 26 this.connectionStatusUpdateHandler_ = null; | 27 this.connectionStatusUpdateHandler_ = null; |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 | 129 |
| 129 remoting.MockClientPlugin.prototype.sendClientMessage = | 130 remoting.MockClientPlugin.prototype.sendClientMessage = |
| 130 function(name, data) {}; | 131 function(name, data) {}; |
| 131 | 132 |
| 132 remoting.MockClientPlugin.prototype.setOnOutgoingIqHandler = | 133 remoting.MockClientPlugin.prototype.setOnOutgoingIqHandler = |
| 133 function(handler) {}; | 134 function(handler) {}; |
| 134 | 135 |
| 135 remoting.MockClientPlugin.prototype.setOnDebugMessageHandler = | 136 remoting.MockClientPlugin.prototype.setOnDebugMessageHandler = |
| 136 function(handler) {}; | 137 function(handler) {}; |
| 137 | 138 |
| 139 /** |
| 140 * @param {function(number, number):void} handler |
| 141 * @private |
| 142 */ |
| 138 remoting.MockClientPlugin.prototype.setConnectionStatusUpdateHandler = | 143 remoting.MockClientPlugin.prototype.setConnectionStatusUpdateHandler = |
| 139 function(handler) { | 144 function(handler) { |
| 145 /** @type {function(number, number):void} */ |
| 140 this.connectionStatusUpdateHandler_ = handler; | 146 this.connectionStatusUpdateHandler_ = handler; |
| 141 }; | 147 }; |
| 142 | 148 |
| 143 remoting.MockClientPlugin.prototype.setRouteChangedHandler = | 149 remoting.MockClientPlugin.prototype.setRouteChangedHandler = |
| 144 function(handler) {}; | 150 function(handler) {}; |
| 145 | 151 |
| 146 remoting.MockClientPlugin.prototype.setConnectionReadyHandler = | 152 remoting.MockClientPlugin.prototype.setConnectionReadyHandler = |
| 147 function(handler) {}; | 153 function(handler) {}; |
| 148 | 154 |
| 149 remoting.MockClientPlugin.prototype.setDesktopSizeUpdateHandler = | 155 remoting.MockClientPlugin.prototype.setDesktopSizeUpdateHandler = |
| (...skipping 25 matching lines...) Expand all Loading... |
| 175 * @extends {remoting.ClientPluginFactory} | 181 * @extends {remoting.ClientPluginFactory} |
| 176 */ | 182 */ |
| 177 remoting.MockClientPluginFactory = function() {}; | 183 remoting.MockClientPluginFactory = function() {}; |
| 178 | 184 |
| 179 remoting.MockClientPluginFactory.prototype.createPlugin = | 185 remoting.MockClientPluginFactory.prototype.createPlugin = |
| 180 function(container, onExtensionMessage) { | 186 function(container, onExtensionMessage) { |
| 181 return new remoting.MockClientPlugin(container); | 187 return new remoting.MockClientPlugin(container); |
| 182 }; | 188 }; |
| 183 | 189 |
| 184 remoting.MockClientPluginFactory.prototype.preloadPlugin = function() {}; | 190 remoting.MockClientPluginFactory.prototype.preloadPlugin = function() {}; |
| OLD | NEW |