Index: services/js/test/echo.js |
diff --git a/services/js/test/echo.js b/services/js/test/echo.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..3fc286476a1f6849d08e4e0c86b5f3239ce22b2e |
--- /dev/null |
+++ b/services/js/test/echo.js |
@@ -0,0 +1,32 @@ |
+#!mojo:js_content_handler |
+ |
+define("main", [ |
+ "console", |
+ "mojo/services/public/js/service-provider", |
+ "services/js/test/echo_service.mojom", |
+ "services/js/app-bridge", |
+], function(console, spModule, echoModule, appModule) { |
+ |
+ function Application(shell, url) { |
+ this.shell = shell; |
+ this.serviceProviders = []; |
+ } |
+ |
+ Application.prototype.initialize = function(args) { |
+ } |
+ |
+ Application.prototype.acceptConnection = function(url, spHandle) { |
+ function EchoServiceImpl(client) { |
+ this.echoString = function(s) { |
+ if (s == "quit") |
+ appModule.quit(); |
+ return Promise.resolve({value: s}); |
+ }; |
+ } |
+ var serviceProvider = new spModule.ServiceProvider(spHandle); |
+ serviceProvider.provideService(echoModule.EchoService, EchoServiceImpl); |
+ this.serviceProviders.push(serviceProvider); |
+ } |
+ |
+ return Application; |
+}); |