OLD | NEW |
1 <html> | 1 <html> |
2 <import src="/gen/mojo/public/interfaces/application/shell.mojom.sky" as="shellM
ojom" /> | 2 <import src="/gen/mojo/public/interfaces/application/shell.mojom.sky" as="shellM
ojom" /> |
3 <import src="/gen/mojo/public/sky/connection.sky" as="connection" /> | 3 <import src="/gen/mojo/public/sky/connection.sky" as="connection" /> |
4 <import src="/gen/mojo/public/sky/core.sky" as="core" /> | 4 <import src="/gen/mojo/public/sky/core.sky" as="core" /> |
5 <import src="/gen/mojo/services/public/sky/shell.sky" as="shellJS" /> | 5 <import src="/gen/mojo/services/public/sky/shell.sky" as="shellJS" /> |
6 <import src="/gen/services/js/test/echo_service.mojom.sky" as="echoServiceMojom"
/> | 6 <import src="/gen/services/js/test/echo_service.mojom.sky" as="echoServiceMojom"
/> |
7 <import src="/gen/mojo/services/view_manager/public/interfaces/view_manager.mojo
m.sky" as="ViewManager"> | 7 <import src="/gen/mojo/services/view_manager/public/interfaces/view_manager.mojo
m.sky" as="ViewManager"> |
8 <import src="/gen/mojo/services/input_events/public/interfaces/input_events.mojo
m.sky" as="InputEvents"/> | 8 <import src="/gen/mojo/services/input_events/public/interfaces/input_events.mojo
m.sky" as="InputEvents"/> |
9 <import src="/sky/framework/sky-element/sky-element.sky" as="SkyElement" /> | 9 <import src="/sky/framework/sky-element/sky-element.sky" as="SkyElement" /> |
10 | 10 |
11 <iframe></iframe> | 11 <iframe></iframe> |
12 | 12 |
13 <script> | 13 <script> |
14 var shellHandle = internals.passShellProxyHandle(); | 14 var shellHandle = internals.takeShellProxyHandle(); |
15 var shellProxy = connection.bindHandleToProxy(shellHandle, shellMojom.Shell); | 15 var shellProxy = connection.bindHandleToProxy(shellHandle, shellMojom.Shell); |
16 var shell = new shellJS.Shell(shellProxy); | 16 var shell = new shellJS.Shell(shellProxy); |
17 | 17 |
18 // The vmcApp provides ViewManagerClient and EchoService. | 18 // The vmcApp provides ViewManagerClient and EchoService. |
19 var vmcURL = "http://127.0.0.1:8000/sky/tests/services/resources/iframe-vmc.js" | 19 var vmcURL = "http://127.0.0.1:8000/sky/tests/services/resources/iframe-vmc.js" |
20 var vmcApp = shell.connectToApplication(vmcURL); | 20 var vmcApp = shell.connectToApplication(vmcURL); |
21 | 21 |
22 // The Promise returned by the vmcApp's echoString() method will not | 22 // The Promise returned by the vmcApp's echoString() method will not |
23 // resolve until the vmcApp's onEmbed() method runs. | 23 // resolve until the vmcApp's onEmbed() method runs. |
24 var echoService = vmcApp.requestService(echoServiceMojom.EchoService); | 24 var echoService = vmcApp.requestService(echoServiceMojom.EchoService); |
25 echoService.echoString("success").then(function(response) { | 25 echoService.echoString("success").then(function(response) { |
26 internals.notifyTestComplete(response.value); | 26 internals.notifyTestComplete(response.value); |
27 }); | 27 }); |
28 | 28 |
29 // Using internals.connectToService here, instead of just connecting | 29 // Using internals.connectToService here, instead of just connecting |
30 // with vmcApp, because we just need a MessagePipe handle (not a proxy). | 30 // with vmcApp, because we just need a MessagePipe handle (not a proxy). |
31 var vmcService = internals.connectToService(vmcURL, ViewManager.ViewManagerClien
t.name); | 31 var vmcService = internals.connectToService(vmcURL, ViewManager.ViewManagerClien
t.name); |
32 document.querySelector("iframe").embedViewManagerClient(vmcService); | 32 document.querySelector("iframe").embedViewManagerClient(vmcService); |
33 </script> | 33 </script> |
34 </html> | 34 </html> |
OLD | NEW |