Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(63)

Side by Side Diff: third_party/WebKit/LayoutTests/presentation/resources/presentation-receiver-postmessage.html

Issue 2484273003: [Presentation API] (1-UA) fire PresentationConnection onterminate event if receiver page gets destr… (Closed)
Patch Set: rebase Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698