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

Side by Side Diff: third_party/WebKit/LayoutTests/harness-tests/mojo-helpers.html

Issue 1707233003: Expose mojo bindings to subframes in layout tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@layout-test-mojom
Patch Set: Created 4 years, 9 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
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <script src="../resources/testharness.js"></script> 2 <script src="../resources/testharness.js"></script>
3 <script src="../resources/testharnessreport.js"></script> 3 <script src="../resources/testharnessreport.js"></script>
4 <script src="../resources/mojo-helpers.js"></script> 4 <script src="../resources/mojo-helpers.js"></script>
5 <script> 5 <script>
6 'use strict'; 6 'use strict';
7 7
8 // Verify that the mojo_test helper functions properly and Mojo bindings 8 // Verify that the mojo_test helper functions properly and Mojo bindings
9 // are available. 9 // are available.
10 mojo_test(mojo => { 10 mojo_test(mojo => {
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 mojo_test(() => { 77 mojo_test(() => {
78 return loadMojoModules( 78 return loadMojoModules(
79 'module loading test', 79 'module loading test',
80 ['mojo/shell/public/interfaces/interface_provider.mojom']).then(mojo => { 80 ['mojo/shell/public/interfaces/interface_provider.mojom']).then(mojo => {
81 let interfaceProvider = mojo.modules[0]; 81 let interfaceProvider = mojo.modules[0];
82 assert_equals(interfaceProvider.InterfaceProvider.name, 82 assert_equals(interfaceProvider.InterfaceProvider.name,
83 'mojo::shell::mojom::InterfaceProvider'); 83 'mojo::shell::mojom::InterfaceProvider');
84 84
85 }); 85 });
86 }, 'Generated mojo bindings can be loaded in tests'); 86 }, 'Generated mojo bindings can be loaded in tests');
87
88 mojo_test(() => {
89 return new Promise(resolve => {
90 let iframe = document.createElement('iframe');
91 let listener = result => {
92 document.body.removeChild(iframe);
93 window.removeEventListener('message', listener);
94 assert_true(result.data);
95 resolve();
96 }
97 window.addEventListener('message', listener);
98 iframe.setAttribute('src', 'resources/mojo-helpers-inner.html');
99 document.body.appendChild(iframe);
100 });
101 }, 'Mojo bindings are accessible from iframes');
102
103 mojo_test(() => {
104 return new Promise(resolve => {
105 let popup;
106 let listener = result => {
107 popup.close();
108 window.removeEventListener('message', listener);
109 assert_true(result.data);
110 resolve();
111 }
112 window.addEventListener('message', listener);
113 popup = window.open('resources/mojo-helpers-inner.html');
114 });
115 }, 'Mojo bindings are accessible from popups');
87 </script> 116 </script>
OLDNEW
« no previous file with comments | « content/renderer/render_view_impl.cc ('k') | third_party/WebKit/LayoutTests/harness-tests/resources/mojo-helpers-inner.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698