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

Unified Diff: third_party/WebKit/LayoutTests/webshare/resources/mock-share-service.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
« 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 0e04983b5d29049b8d1b4cfec952d50d3a6102be..c1f1736798d35be428b987b3e0714a3a5b5fe985 100644
--- a/third_party/WebKit/LayoutTests/webshare/resources/mock-share-service.js
+++ b/third_party/WebKit/LayoutTests/webshare/resources/mock-share-service.js
@@ -2,18 +2,17 @@
let mockShareService = loadMojoModules(
'mockShareService',
- ['mojo/public/js/bindings',
+ ['mojo/public/js/router',
'third_party/WebKit/public/platform/modules/webshare/webshare.mojom',
]).then(mojo => {
- let [bindings, webshare] = mojo.modules;
+ let [router, webshare] = mojo.modules;
- class MockShareService {
+ class MockShareService extends webshare.ShareService.stubClass {
constructor(interfaceProvider) {
- this.bindingSet_ = new bindings.BindingSet(webshare.ShareService);
-
+ super();
interfaceProvider.addInterfaceOverrideForTesting(
webshare.ShareService.name,
- handle => this.bindingSet_.addBinding(this, handle));
+ handle => this.connect_(handle));
}
// Returns a Promise that gets rejected if the test should fail.
@@ -22,6 +21,11 @@
this.shareResultQueue_ = [];
return new Promise((resolve, reject) => {this.reject_ = reject});
+ }
+
+ connect_(handle) {
+ this.router_ = new router.Router(handle);
+ this.router_.setIncomingReceiver(this);
}
share(title, text, url) {
« 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