Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <body> | 3 <body> |
| 4 <script src="../resources/testharness.js"></script> | 4 <script src="../resources/testharness.js"></script> |
| 5 <script src="../resources/testharnessreport.js"></script> | 5 <script src="../resources/testharnessreport.js"></script> |
| 6 <script src="../resources/mojo-helpers.js"></script> | 6 <script src="../resources/mojo-helpers.js"></script> |
| 7 <script src="resources/presentation-service-mock.js"></script> | 7 <script src="resources/presentation-service-mock.js"></script> |
| 8 <button>click me</button> | 8 <button>click me</button> |
| 9 <script> | 9 <script> |
| 10 | 10 |
| 11 async_test(t => { | 11 async_test(t => { |
| 12 presentationServiceMock.then(mockService => { | 12 presentationServiceMock.then(mockService => { |
| 13 var button = document.querySelector('button'); | 13 var button = document.querySelector('button'); |
|
imcheng
2017/03/13 21:17:55
const?
| |
| 14 // This is receiving the user gesture and runs the callback. | 14 // This is receiving the user gesture and runs the callback. |
| 15 waitForClick(() => { | 15 waitForClick(() => { |
| 16 new PresentationRequest('https://example.com').start().then( | 16 new PresentationRequest('https://example.com').start().then( |
| 17 connection => { | 17 connection => { |
| 18 connection.onterminate = t.step_func_done(); | 18 connection.onterminate = t.step_func_done(); |
| 19 connection.onconnect = () => { | 19 connection.onconnect = () => { |
| 20 connection.terminate(); | 20 connection.terminate(); |
| 21 }; | 21 }; |
| 22 }); | 22 }); |
| 23 }, button); | 23 }, button); |
| 24 }); | 24 }); |
| 25 }, "Test that controller connection.terminate() fires onterminate event handler. "); | 25 }, "Test that controller connection.terminate() fires onterminate event handler. "); |
| 26 | 26 |
| 27 </script> | 27 </script> |
| 28 </body> | 28 </body> |
| 29 </html> | 29 </html> |
| OLD | NEW |