Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <html> | |
| 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" /> | |
| 4 <import src="/gen/mojo/public/sky/core.sky" as="core" /> | |
| 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" /> | |
| 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"/> | |
| 9 <import src="/sky/framework/sky-element/sky-element.sky" as="SkyElement" /> | |
| 10 | |
| 11 <iframe src="about:blank"></iframe> | |
|
abarth-chromium
2015/02/11 01:02:13
You can skip the src. It defaults to about:blank
hansmuller1
2015/02/11 01:09:01
Done.
| |
| 12 | |
| 13 <script> | |
| 14 var shellHandle = internals.passShellProxyHandle(); | |
| 15 var shellProxy = connection.bindHandleToProxy(shellHandle, shellMojom.Shell); | |
| 16 var shell = new shellJS.Shell(shellProxy); | |
| 17 | |
| 18 // The vmcApp provides ViewManagerClient and EchoService. | |
| 19 var vmcURL = "http://127.0.0.1:8000/sky/tests/services/resources/iframe-vmc.js" | |
| 20 var vmcApp = shell.connectToApplication(vmcURL); | |
| 21 | |
| 22 // The Promise returned by the vmcApp's echoString() method will not | |
| 23 // resolve until the vmcApp's onEmbed() method runs. | |
| 24 var echoService = vmcApp.requestService(echoServiceMojom.EchoService); | |
| 25 echoService.echoString("success").then(function(response) { | |
| 26 internals.notifyTestComplete(response.value); | |
| 27 }); | |
| 28 | |
| 29 // Using internals.connectToService here, instead of just connecting | |
| 30 // with vmcApp, because we just need a MessagePipe handle (not a proxy). | |
| 31 var vmcService = internals.connectToService(vmcURL, ViewManager.ViewManagerClien t.name); | |
| 32 document.querySelector("iframe").embedViewManagerClient(vmcService); | |
| 33 </script> | |
| 34 </html> | |
| OLD | NEW |