| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 Tests for chrome://bluetooth-internals | 6 * @fileoverview Tests for chrome://bluetooth-internals |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 /** @const {string} Path to source root. */ | 9 /** @const {string} Path to source root. */ |
| 10 var ROOT_PATH = '../../../../'; | 10 var ROOT_PATH = '../../../../'; |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 * | 60 * |
| 61 * @constructor | 61 * @constructor |
| 62 * @extends {TestBrowserProxyBase} | 62 * @extends {TestBrowserProxyBase} |
| 63 */ | 63 */ |
| 64 var TestAdapterFactoryProxy = function() { | 64 var TestAdapterFactoryProxy = function() { |
| 65 settings.TestBrowserProxy.call(this, [ | 65 settings.TestBrowserProxy.call(this, [ |
| 66 'getAdapter', | 66 'getAdapter', |
| 67 ]); | 67 ]); |
| 68 | 68 |
| 69 this.adapter = new TestAdapter(); | 69 this.adapter = new TestAdapter(); |
| 70 this.adapterHandle_ = connection.bindStubDerivedImpl(this.adapter); | 70 this.adapterBinding_ = new bindings.Binding(adapter.Adapter, |
| 71 this.adapter); |
| 71 }; | 72 }; |
| 72 | 73 |
| 73 TestAdapterFactoryProxy.prototype = { | 74 TestAdapterFactoryProxy.prototype = { |
| 74 __proto__: settings.TestBrowserProxy.prototype, | 75 __proto__: settings.TestBrowserProxy.prototype, |
| 75 getAdapter: function() { | 76 getAdapter: function() { |
| 76 this.methodCalled('getAdapter'); | 77 this.methodCalled('getAdapter'); |
| 77 | 78 |
| 78 // Create message pipe bound to TestAdapter. | 79 // Create message pipe bound to TestAdapter. |
| 79 return Promise.resolve({ | 80 return Promise.resolve({ |
| 80 adapter: this.adapterHandle_, | 81 adapter: this.adapterBinding_.createInterfacePtrAndBind(), |
| 81 }); | 82 }); |
| 82 } | 83 } |
| 83 }; | 84 }; |
| 84 | 85 |
| 85 /** | 86 /** |
| 86 * A test adapter for the chrome://bluetooth-internals page. | 87 * A test adapter for the chrome://bluetooth-internals page. |
| 87 * Must be used to create message pipe handle from test code. | 88 * Must be used to create message pipe handle from test code. |
| 88 * | 89 * |
| 89 * @constructor | 90 * @constructor |
| 90 * @extends {adapter.Adapter.stubClass} | 91 * @extends {adapter.Adapter.stubClass} |
| (...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 422 var newDeviceInfo3 = fakeDeviceInfo3(); | 423 var newDeviceInfo3 = fakeDeviceInfo3(); |
| 423 newDeviceInfo3.rssi = {value: -17}; | 424 newDeviceInfo3.rssi = {value: -17}; |
| 424 adapterBroker.adapterClient_.deviceChanged(newDeviceInfo3); | 425 adapterBroker.adapterClient_.deviceChanged(newDeviceInfo3); |
| 425 expectEquals('-17', rssiColumn.textContent); | 426 expectEquals('-17', rssiColumn.textContent); |
| 426 }); | 427 }); |
| 427 }); | 428 }); |
| 428 | 429 |
| 429 // Run all registered tests. | 430 // Run all registered tests. |
| 430 mocha.run(); | 431 mocha.run(); |
| 431 }); | 432 }); |
| OLD | NEW |