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

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, 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
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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 let pipe = mojo.serviceRegistry.connectToService('Reversinator'); 66 let pipe = mojo.serviceRegistry.connectToService('Reversinator');
67 assert_equals(mojo.core.writeMessage(pipe, TEST_REQUEST, [], 0), 67 assert_equals(mojo.core.writeMessage(pipe, TEST_REQUEST, [], 0),
68 mojo.core.RESULT_OK); 68 mojo.core.RESULT_OK);
69 69
70 return mojo_wait_for_incoming_message(mojo, pipe) 70 return mojo_wait_for_incoming_message(mojo, pipe)
71 .then(response => { 71 .then(response => {
72 assert_array_equals(new Uint8Array(response.buffer), EXPECTED_RESPONSE); 72 assert_array_equals(new Uint8Array(response.buffer), EXPECTED_RESPONSE);
73 assert_array_equals(response.handles, []); 73 assert_array_equals(response.handles, []);
74 }); 74 });
75 }, 'Test code can receive response messages from mock services.'); 75 }, 'Test code can receive response messages from mock services.');
76
77 mojo_test(() => {
78 return new Promise(resolve => {
79 let iframe = document.createElement('iframe');
80 let listener = result => {
81 document.body.removeChild(iframe);
82 window.removeEventListener('message', listener);
83 assert_true(result.data);
84 resolve();
85 }
86 window.addEventListener('message', listener);
87 iframe.setAttribute('src', 'resources/mojo-helpers-inner.html');
88 document.body.appendChild(iframe);
89
Ken Rockot(use gerrit already) 2016/02/19 00:23:45 nit: -vspace
Sam McNally 2016/02/19 02:25:37 Done.
90 });
91 }, 'Mojo bindings are accessible from iframes');
76 </script> 92 </script>
OLDNEW
« no previous file with comments | « content/renderer/render_frame_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