OLD | NEW |
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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 return mojo_wait_for_incoming_message(mojo, pipe) | 87 return mojo_wait_for_incoming_message(mojo, pipe) |
88 .then(response => { | 88 .then(response => { |
89 assert_array_equals(new Uint8Array(response.buffer), EXPECTED_RESPONSE); | 89 assert_array_equals(new Uint8Array(response.buffer), EXPECTED_RESPONSE); |
90 assert_array_equals(response.handles, []); | 90 assert_array_equals(response.handles, []); |
91 }); | 91 }); |
92 }, 'Test code can receive response messages from mock services.'); | 92 }, 'Test code can receive response messages from mock services.'); |
93 | 93 |
94 mojo_test(() => { | 94 mojo_test(() => { |
95 return loadMojoModules( | 95 return loadMojoModules( |
96 'module loading test', | 96 'module loading test', |
97 ['mojo/shell/public/interfaces/interface_provider.mojom']).then(mojo => { | 97 ['services/shell/public/interfaces/interface_provider.mojom']).then(mojo =
> { |
98 let interfaceProvider = mojo.modules[0]; | 98 let interfaceProvider = mojo.modules[0]; |
99 assert_equals(interfaceProvider.InterfaceProvider.name, | 99 assert_equals(interfaceProvider.InterfaceProvider.name, |
100 'mojo::shell::mojom::InterfaceProvider'); | 100 'mojo::shell::mojom::InterfaceProvider'); |
101 | 101 |
102 }); | 102 }); |
103 }, 'Generated mojo bindings can be loaded in tests'); | 103 }, 'Generated mojo bindings can be loaded in tests'); |
104 | 104 |
105 mojo_test(() => { | 105 mojo_test(() => { |
106 return new Promise(resolve => { | 106 return new Promise(resolve => { |
107 let iframe = document.createElement('iframe'); | 107 let iframe = document.createElement('iframe'); |
(...skipping 16 matching lines...) Expand all Loading... |
124 popup.close(); | 124 popup.close(); |
125 window.removeEventListener('message', listener); | 125 window.removeEventListener('message', listener); |
126 assert_true(result.data); | 126 assert_true(result.data); |
127 resolve(); | 127 resolve(); |
128 } | 128 } |
129 window.addEventListener('message', listener); | 129 window.addEventListener('message', listener); |
130 popup = window.open('resources/mojo-helpers-inner.html'); | 130 popup = window.open('resources/mojo-helpers-inner.html'); |
131 }); | 131 }); |
132 }, 'Mojo bindings are accessible from popups'); | 132 }, 'Mojo bindings are accessible from popups'); |
133 </script> | 133 </script> |
OLD | NEW |