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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <body>
4 <script src="../resources/testharness.js"></script>
5 <script src="../resources/testharnessreport.js"></script>
6 <script src="../resources/gc.js"></script>
7 <script src="../resources/mojo-helpers.js"></script>
8 <script src="resources/presentation-service-mock.js"></script>
9 <button>click me</button>
10 <script>
11
12 function waitForClick(callback) {
13 var button = document.querySelector('button');
14 button.addEventListener('click', callback, { once: true });
15
16 if (!('eventSender' in window))
17 return;
18
19 var boundingRect = button.getBoundingClientRect();
20 var x = boundingRect.left + boundingRect.width / 2;
21 var y = boundingRect.top + boundingRect.height / 2;
22
23 eventSender.mouseMoveTo(x, y);
24 eventSender.mouseDown();
25 eventSender.mouseUp();
26 }
27
28 async_test(t => {
29 presentationServiceMock.then(mockService => {
30 var connection = null;
31 var request = new PresentationRequest('https://example.com');
32
33 waitForClick(_ => {
34 request.start().then(conn => {
35 connection = conn;
36 assert_not_equals(connection, null);
37
38 request.reconnect(connection.id).then(
39 t.step_func_done(conn => {
40 assert_true(connection === conn);
41 }));
42 });
43 });
44 });
45 }, "Test that Presentation.reconnect() resolves with existing presentation conne ction.");
46
47 </script>
48 </body>
49 </html>
OLDNEW
« 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