| OLD | NEW |
| (Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <body> |
| 4 <script src="../../resources/testharness.js"></script> |
| 5 <script src="../../resources/mojo-helpers.js"></script> |
| 6 <script src="presentation-service-mock.js"></script> |
| 7 <script> |
| 8 |
| 9 internals.settings.setPresentationReceiver(true); |
| 10 |
| 11 var connection = null; |
| 12 |
| 13 presentationServiceMock.then(mockService => { |
| 14 const url = 'http://example.com/a.html'; |
| 15 const id = 'fakeSessionId'; |
| 16 |
| 17 mockService.onSetClient = () => { |
| 18 mockService.onReceiverConnectionAvailable(url, id); |
| 19 }; |
| 20 |
| 21 navigator.presentation.receiver.connectionList.then(list => { |
| 22 assert_equals(list.connections.length, 1); |
| 23 connection = list.connections[0]; |
| 24 connection.terminate(); |
| 25 }); |
| 26 }); |
| 27 |
| 28 window.onunload = () => { |
| 29 if (connection.state == 'terminated') { |
| 30 opener.postMessage('passed', '*'); |
| 31 } else { |
| 32 opener.postMessage('failed', '*'); |
| 33 } |
| 34 internals.settings.setPresentationReceiver(false); |
| 35 }; |
| 36 |
| 37 </script> |
| 38 </body> |
| 39 </html> |
| OLD | NEW |