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

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

Issue 2706453002: [Presentation API] return valid WebPresentationConnection object in PresentationReceiver (Closed)
Patch Set: resolve code review comments from Derek 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/presentation/resources/presentation-service-mock.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/presentation/resources/presentation-service-mock.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698