| Index: third_party/WebKit/LayoutTests/presentation/presentation-onreceiverconnection.html
|
| diff --git a/third_party/WebKit/LayoutTests/presentation/presentation-onreceiverconnection.html b/third_party/WebKit/LayoutTests/presentation/presentation-onreceiverconnection.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..b7f550a9b016586af14c4091a2598c89b0e2d2bd
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/presentation/presentation-onreceiverconnection.html
|
| @@ -0,0 +1,36 @@
|
| +<!DOCTYPE html>
|
| +<html>
|
| +<body>
|
| +<script src="../resources/testharness.js"></script>
|
| +<script src="../resources/testharnessreport.js"></script>
|
| +<script src="../resources/mojo-helpers.js"></script>
|
| +<script src="resources/presentation-service-mock.js"></script>
|
| +<script>
|
| +
|
| +async_test(t => {
|
| + internals.settings.setPresentationReceiver(true);
|
| + t.add_cleanup(_ => { internals.settings.setPresentationReceiver(false); });
|
| +
|
| + presentationServiceMock.then(mockService => {
|
| + // Invoke mockService.setClient().
|
| + const receiver = navigator.presentation.receiver;
|
| +
|
| + // Make sure it is invoked after calling setClient().
|
| + setTimeout(() => {
|
| + const url = 'http://example.com/a.html';
|
| + const id = 'fakeSessionId';
|
| + mockService.onReceiverConnectionAvailable(url, id);
|
| +
|
| + receiver.connectionList.then(
|
| + t.step_func_done(list => {
|
| + assert_equals(list.connections.length, 1);
|
| + assert_equals(list.connections[0].url, url);
|
| + assert_equals(list.connections[0].id, id);
|
| + }));
|
| + });
|
| + });
|
| +}, "Test presentation.receiver.connectionList resolves with incoming connection.");
|
| +
|
| +</script>
|
| +</body>
|
| +</html>
|
|
|