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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: sky/tests/services/iframe-embed-vmc.sky
diff --git a/sky/tests/services/iframe-embed-vmc.sky b/sky/tests/services/iframe-embed-vmc.sky
new file mode 100644
index 0000000000000000000000000000000000000000..53898fc8b44a052853f1984a8ddcffbaa15ca493
--- /dev/null
+++ b/sky/tests/services/iframe-embed-vmc.sky
@@ -0,0 +1,34 @@
+<html>
+<import src="/gen/mojo/public/interfaces/application/shell.mojom.sky" as="shellMojom" />
+<import src="/gen/mojo/public/sky/connection.sky" as="connection" />
+<import src="/gen/mojo/public/sky/core.sky" as="core" />
+<import src="/gen/mojo/services/public/sky/shell.sky" as="shellJS" />
+<import src="/gen/services/js/test/echo_service.mojom.sky" as="echoServiceMojom" />
+<import src="/gen/mojo/services/view_manager/public/interfaces/view_manager.mojom.sky" as="ViewManager">
+<import src="/gen/mojo/services/input_events/public/interfaces/input_events.mojom.sky" as="InputEvents"/>
+<import src="/sky/framework/sky-element/sky-element.sky" as="SkyElement" />
+
+<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.
+
+<script>
+var shellHandle = internals.passShellProxyHandle();
+var shellProxy = connection.bindHandleToProxy(shellHandle, shellMojom.Shell);
+var shell = new shellJS.Shell(shellProxy);
+
+// The vmcApp provides ViewManagerClient and EchoService.
+var vmcURL = "http://127.0.0.1:8000/sky/tests/services/resources/iframe-vmc.js"
+var vmcApp = shell.connectToApplication(vmcURL);
+
+// The Promise returned by the vmcApp's echoString() method will not
+// resolve until the vmcApp's onEmbed() method runs.
+var echoService = vmcApp.requestService(echoServiceMojom.EchoService);
+echoService.echoString("success").then(function(response) {
+ internals.notifyTestComplete(response.value);
+});
+
+// Using internals.connectToService here, instead of just connecting
+// with vmcApp, because we just need a MessagePipe handle (not a proxy).
+var vmcService = internals.connectToService(vmcURL, ViewManager.ViewManagerClient.name);
+document.querySelector("iframe").embedViewManagerClient(vmcService);
+</script>
+</html>

Powered by Google App Engine
This is Rietveld 408576698