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

Unified Diff: chrome/test/data/webui/bluetooth_internals_browsertest.js

Issue 2590393002: Revert of Mojo JS bindings: switch most usage of "connection"/"router" module to "bindings". (Closed)
Patch Set: Created 4 years 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
Index: chrome/test/data/webui/bluetooth_internals_browsertest.js
diff --git a/chrome/test/data/webui/bluetooth_internals_browsertest.js b/chrome/test/data/webui/bluetooth_internals_browsertest.js
index 886f0fd7c8796489ab16eeec17af6dacdc25b079..1def822be4f4c55586a4c314e3c6e8e98b3e8f17 100644
--- a/chrome/test/data/webui/bluetooth_internals_browsertest.js
+++ b/chrome/test/data/webui/bluetooth_internals_browsertest.js
@@ -51,7 +51,9 @@
'device/bluetooth/public/interfaces/adapter.mojom',
'device/bluetooth/public/interfaces/device.mojom',
'mojo/public/js/bindings',
- ]).then(function([frameInterfaces, adapter, device, bindings]) {
+ 'mojo/public/js/connection',
+ ]).then(function([frameInterfaces, adapter, device, bindings,
+ connection]) {
/**
* A test adapter factory proxy for the chrome://bluetooth-internals
* page.
@@ -64,7 +66,6 @@
'getAdapter',
]);
- this.binding = new bindings.Binding(adapter.AdapterFactory, this);
this.adapter = new TestAdapter();
this.adapterBinding_ = new bindings.Binding(adapter.Adapter,
this.adapter);
@@ -87,12 +88,14 @@
* Must be used to create message pipe handle from test code.
*
* @constructor
+ * @extends {adapter.Adapter.stubClass}
*/
var TestAdapter = function() {
this.proxy = new TestAdapterProxy();
};
TestAdapter.prototype = {
+ __proto__: adapter.Adapter.stubClass.prototype,
getInfo: function() { return this.proxy.getInfo(); },
getDevices: function() { return this.proxy.getDevices(); },
setClient: function(client) { return this.proxy.setClient(client); }
@@ -143,8 +146,10 @@
frameInterfaces.addInterfaceOverrideForTesting(
adapter.AdapterFactory.name, function(handle) {
+ var stub = connection.bindHandleToStub(
+ handle, adapter.AdapterFactory);
+
this.adapterFactory = new TestAdapterFactoryProxy();
- this.adapterFactory.binding.bind(handle);
this.adapterFactory.adapter.proxy.setTestDevices([
this.fakeDeviceInfo1(),
@@ -152,6 +157,8 @@
]);
this.adapterFactory.adapter.proxy.setTestAdapter(
this.fakeAdapterInfo());
+
+ bindings.StubBindings(stub).delegate = this.adapterFactory;
this.setupResolver.resolve();
}.bind(this));
« no previous file with comments | « chrome/browser/resources/usb_internals/usb_internals.js ('k') | chrome/test/data/webui/plugins_browsertest.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698