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

Side by Side Diff: third_party/WebKit/LayoutTests/presentation/presentation-close-reconnect.html

Issue 2643473002: [Presentation API] Allow PresentationConnection state change to "Connecting" (Closed)
Patch Set: Address Mark and Bin's comments 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 unified diff | Download patch
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/mojo-helpers.js"></script>
7 <script src="resources/presentation-service-mock.js"></script>
8 <button>click me</button>
9 <script>
10
11 async_test(t => {
12 presentationServiceMock.then(mockService => {
13 const button = document.querySelector('button');
14 let connection = null;
15 const request = new PresentationRequest('https://example.com');
16
17 waitForClick(_ => {
18 request.start().then(conn => {
19 connection = conn;
20 assert_not_equals(connection, null);
21 assert_equals(connection.state, 'connecting');
22
23 connection.onclose = (_ => {
24 assert_equals(connection.state, 'closed');
25 request.reconnect(connection.id).then(
26 t.step_func_done(conn => {
27 assert_equals(connection, conn);
28 assert_equals(connection.state, 'connecting');
29 })
30 );
31 });
32 connection.close();
33 });
34 }, button);
35 });
36 }, "Test that Presentation.reconnect() resolves with a previously closed present ation connection, whose state is updated to 'connecting.'");
37
38 </script>
39 </body>
40 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698