| 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/gc.js"></script> |
| 6 <script src="../resources/mojo-helpers.js"></script> | 7 <script src="../resources/mojo-helpers.js"></script> |
| 7 <script src="resources/presentation-service-mock.js"></script> | 8 <script src="resources/presentation-service-mock.js"></script> |
| 8 <button>click me</button> | 9 <button>click me</button> |
| 9 <script> | 10 <script> |
| 10 | 11 |
| 11 async_test(t => { | 12 async_test(t => { |
| 12 presentationServiceMock.then(mockService => { | 13 presentationServiceMock.then(mockService => { |
| 13 const button = document.querySelector('button'); | 14 var button = document.querySelector('button'); |
| 14 let connection = null; | 15 var connection = null; |
| 15 const request = new PresentationRequest('https://example.com'); | 16 var request = new PresentationRequest('https://example.com'); |
| 16 | 17 |
| 17 waitForClick(_ => { | 18 waitForClick(_ => { |
| 18 request.start().then(conn => { | 19 request.start().then(conn => { |
| 19 connection = conn; | 20 connection = conn; |
| 20 assert_not_equals(connection, null); | 21 assert_not_equals(connection, null); |
| 21 | 22 |
| 22 request.reconnect(connection.id).then( | 23 request.reconnect(connection.id).then( |
| 23 t.step_func_done(conn => { | 24 t.step_func_done(conn => { |
| 24 assert_true(connection === conn); | 25 assert_true(connection === conn); |
| 25 })); | 26 })); |
| 26 }); | 27 }); |
| 27 }, button); | 28 }, button); |
| 28 }); | 29 }); |
| 29 }, "Test that Presentation.reconnect() resolves with existing presentation conne
ction."); | 30 }, "Test that Presentation.reconnect() resolves with existing presentation conne
ction."); |
| 30 | 31 |
| 31 </script> | 32 </script> |
| 32 </body> | 33 </body> |
| 33 </html> | 34 </html> |
| OLD | NEW |