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