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

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

Issue 2602523002: [Presentation API] Resolve PresentationRequest::reconnect() with existing presentation connection i… (Closed)
Patch Set: remove getExecutionContext() null check in PresentationRequest::reconnect() Created 3 years, 11 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-reconnect.html
diff --git a/third_party/WebKit/LayoutTests/presentation/presentation-reconnect.html b/third_party/WebKit/LayoutTests/presentation/presentation-reconnect.html
new file mode 100644
index 0000000000000000000000000000000000000000..c9c7a7d02d6cadf131b25e1f274f3546eb638c28
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/presentation/presentation-reconnect.html
@@ -0,0 +1,49 @@
+<!DOCTYPE html>
+<html>
+<body>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<script src="../resources/gc.js"></script>
+<script src="../resources/mojo-helpers.js"></script>
+<script src="resources/presentation-service-mock.js"></script>
+<button>click me</button>
+<script>
+
+function waitForClick(callback) {
+ var button = document.querySelector('button');
+ button.addEventListener('click', callback, { once: true });
+
+ if (!('eventSender' in window))
+ return;
+
+ var boundingRect = button.getBoundingClientRect();
+ var x = boundingRect.left + boundingRect.width / 2;
+ var y = boundingRect.top + boundingRect.height / 2;
+
+ eventSender.mouseMoveTo(x, y);
+ eventSender.mouseDown();
+ eventSender.mouseUp();
+}
+
+async_test(t => {
+ presentationServiceMock.then(mockService => {
+ var connection = null;
+ var request = new PresentationRequest('https://example.com');
+
+ waitForClick(_ => {
+ request.start().then(conn => {
+ connection = conn;
+ assert_not_equals(connection, null);
+
+ request.reconnect(connection.id).then(
+ t.step_func_done(conn => {
+ assert_true(connection === conn);
+ }));
+ });
+ });
+ });
+}, "Test that Presentation.reconnect() resolves with existing presentation 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