| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 'use strict'; | 5 'use strict'; |
| 6 | 6 |
| 7 /** @suppress {duplicate} */ | 7 /** @suppress {duplicate} */ |
| 8 var remoting = remoting || {}; | 8 var remoting = remoting || {}; |
| 9 | 9 |
| 10 | 10 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 var that = this; | 38 var that = this; |
| 39 Promise.resolve().then(function() { | 39 Promise.resolve().then(function() { |
| 40 that.setStateForTesting(remoting.SignalStrategy.State.CONNECTED); | 40 that.setStateForTesting(remoting.SignalStrategy.State.CONNECTED); |
| 41 }); | 41 }); |
| 42 }; | 42 }; |
| 43 | 43 |
| 44 /** @override */ | 44 /** @override */ |
| 45 remoting.MockSignalStrategy.prototype.sendMessage = function() { | 45 remoting.MockSignalStrategy.prototype.sendMessage = function() { |
| 46 }; | 46 }; |
| 47 | 47 |
| 48 /** @override */ | |
| 49 remoting.MockSignalStrategy.prototype.sendConnectionSetupResults = function() { | |
| 50 }; | |
| 51 | |
| 52 /** | 48 /** |
| 53 * @param {function(remoting.SignalStrategy.State):void} onStateChangedCallback | 49 * @param {function(remoting.SignalStrategy.State):void} onStateChangedCallback |
| 54 * Callback to call on state change. | 50 * Callback to call on state change. |
| 55 */ | 51 */ |
| 56 remoting.MockSignalStrategy.prototype.setStateChangedCallback = function( | 52 remoting.MockSignalStrategy.prototype.setStateChangedCallback = function( |
| 57 onStateChangedCallback) { | 53 onStateChangedCallback) { |
| 58 this.onStateChangedCallback_ = onStateChangedCallback; | 54 this.onStateChangedCallback_ = onStateChangedCallback; |
| 59 }; | 55 }; |
| 60 | 56 |
| 61 /** | 57 /** |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 */ | 95 */ |
| 100 remoting.MockSignalStrategy.prototype.setStateForTesting = function(state) { | 96 remoting.MockSignalStrategy.prototype.setStateForTesting = function(state) { |
| 101 this.state_ = state; | 97 this.state_ = state; |
| 102 if (state == remoting.SignalStrategy.State.FAILED) { | 98 if (state == remoting.SignalStrategy.State.FAILED) { |
| 103 this.error_ = remoting.Error.unexpected('setStateForTesting'); | 99 this.error_ = remoting.Error.unexpected('setStateForTesting'); |
| 104 } else { | 100 } else { |
| 105 this.error_ = remoting.Error.none(); | 101 this.error_ = remoting.Error.none(); |
| 106 } | 102 } |
| 107 this.onStateChangedCallback_(state); | 103 this.onStateChangedCallback_(state); |
| 108 }; | 104 }; |
| OLD | NEW |