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

Unified Diff: sky/tests/services/resources/iframe-vmc.js

Issue 912183002: Adds support for embedViewManagerClient() to IFrame. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 10 months 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: sky/tests/services/resources/iframe-vmc.js
diff --git a/sky/tests/services/resources/iframe-vmc.js b/sky/tests/services/resources/iframe-vmc.js
new file mode 100644
index 0000000000000000000000000000000000000000..6dbc7d3e8f2356c4d02974802f08da1e23631bb3
--- /dev/null
+++ b/sky/tests/services/resources/iframe-vmc.js
@@ -0,0 +1,36 @@
+#!mojo mojo:js_content_handler
+
+define("main", [
+ "console",
+ "mojo/public/js/bindings",
+ "mojo/services/public/js/application",
+ "mojo/services/view_manager/public/interfaces/view_manager.mojom",
+ "services/js/test/echo_service.mojom",
+], function(console, bindings, application, viewManagerMojom, echoServiceMojom) {
+
+ const Application = application.Application;
+ const ViewManagerClient = viewManagerMojom.ViewManagerClient;
+ const EchoService = echoServiceMojom.EchoService;
+
+ var serviceImpl;
+ var success = new Promise(function(resolve) {
+ serviceImpl = {
+ onEmbed: function() {
+ resolve({value: "success"});
+ },
+ echoString: function(s) {
+ return success;
+ },
+ }
+ });
+
+ class IFrameVMCApp extends Application {
+ acceptConnection(initiatorURL, initiatorServiceExchange) {
+ var factory = function() { return serviceImpl; }
+ initiatorServiceExchange.provideService(ViewManagerClient, factory);
+ initiatorServiceExchange.provideService(EchoService, factory);
+ }
+ }
+
+ return IFrameVMCApp;
+});
« sky/tests/services/iframe-embed-vmc.sky ('K') | « sky/tests/services/iframe-embed-vmc-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698