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

Unified Diff: third_party/WebKit/LayoutTests/webshare/resources/mock-share-service.js

Issue 2571903003: Mojo JS bindings: switch most usage of "connection"/"router" module to "bindings". (Closed)
Patch Set: remove the changes to web_ui_mojo.js which seemed to cause flakiness. 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
« no previous file with comments | « third_party/WebKit/LayoutTests/shapedetection/resources/mock-facedetection.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/webshare/resources/mock-share-service.js
diff --git a/third_party/WebKit/LayoutTests/webshare/resources/mock-share-service.js b/third_party/WebKit/LayoutTests/webshare/resources/mock-share-service.js
index c1f1736798d35be428b987b3e0714a3a5b5fe985..0e04983b5d29049b8d1b4cfec952d50d3a6102be 100644
--- a/third_party/WebKit/LayoutTests/webshare/resources/mock-share-service.js
+++ b/third_party/WebKit/LayoutTests/webshare/resources/mock-share-service.js
@@ -2,17 +2,18 @@
let mockShareService = loadMojoModules(
'mockShareService',
- ['mojo/public/js/router',
+ ['mojo/public/js/bindings',
'third_party/WebKit/public/platform/modules/webshare/webshare.mojom',
]).then(mojo => {
- let [router, webshare] = mojo.modules;
+ let [bindings, webshare] = mojo.modules;
- class MockShareService extends webshare.ShareService.stubClass {
+ class MockShareService {
constructor(interfaceProvider) {
- super();
+ this.bindingSet_ = new bindings.BindingSet(webshare.ShareService);
+
interfaceProvider.addInterfaceOverrideForTesting(
webshare.ShareService.name,
- handle => this.connect_(handle));
+ handle => this.bindingSet_.addBinding(this, handle));
}
// Returns a Promise that gets rejected if the test should fail.
@@ -23,11 +24,6 @@ let mockShareService = loadMojoModules(
return new Promise((resolve, reject) => {this.reject_ = reject});
}
- connect_(handle) {
- this.router_ = new router.Router(handle);
- this.router_.setIncomingReceiver(this);
- }
-
share(title, text, url) {
let callback = null;
let result = new Promise(resolve => {callback = resolve;});
« no previous file with comments | « third_party/WebKit/LayoutTests/shapedetection/resources/mock-facedetection.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698