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

Side by Side Diff: sky/tests/services/iframe-embed-vmc.sky

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 unified diff | Download patch
OLDNEW
(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>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698