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

Unified Diff: third_party/WebKit/LayoutTests/presentation/presentation-onreceiverconnection.html

Issue 2484273003: [Presentation API] (1-UA) fire PresentationConnection onterminate event if receiver page gets destr… (Closed)
Patch Set: rebase Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
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
index b7f550a9b016586af14c4091a2598c89b0e2d2bd..f018fb2efa4775b8e96d3336e002a7d95c524bf0 100644
--- a/third_party/WebKit/LayoutTests/presentation/presentation-onreceiverconnection.html
+++ b/third_party/WebKit/LayoutTests/presentation/presentation-onreceiverconnection.html
@@ -12,22 +12,19 @@ async_test(t => {
t.add_cleanup(_ => { internals.settings.setPresentationReceiver(false); });
presentationServiceMock.then(mockService => {
- // Invoke mockService.setClient().
- const receiver = navigator.presentation.receiver;
+ const url = 'http://example.com/a.html';
+ const id = 'fakeSessionId';
- // Make sure it is invoked after calling setClient().
- setTimeout(() => {
- const url = 'http://example.com/a.html';
- const id = 'fakeSessionId';
+ mockService.onSetClient = () => {
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);
+ navigator.presentation.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.");

Powered by Google App Engine
This is Rietveld 408576698