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

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

Issue 2643473002: [Presentation API] Allow PresentationConnection state change to "Connecting" (Closed)
Patch Set: Address Mark and Bin's comments 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
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <body> 3 <body>
4 <script src="../resources/testharness.js"></script> 4 <script src="../resources/testharness.js"></script>
5 <script src="../resources/testharnessreport.js"></script> 5 <script src="../resources/testharnessreport.js"></script>
6 <script src="../resources/gc.js"></script>
7 <script src="../resources/mojo-helpers.js"></script> 6 <script src="../resources/mojo-helpers.js"></script>
8 <script src="resources/presentation-service-mock.js"></script> 7 <script src="resources/presentation-service-mock.js"></script>
9 <button>click me</button> 8 <button>click me</button>
10 <script> 9 <script>
11 10
12 async_test(t => { 11 async_test(t => {
13 presentationServiceMock.then(mockService => { 12 presentationServiceMock.then(mockService => {
14 var button = document.querySelector('button'); 13 const button = document.querySelector('button');
15 var connection = null; 14 let connection = null;
16 var request = new PresentationRequest('https://example.com'); 15 const request = new PresentationRequest('https://example.com');
17 16
18 waitForClick(_ => { 17 waitForClick(_ => {
19 request.start().then(conn => { 18 request.start().then(conn => {
20 connection = conn; 19 connection = conn;
21 assert_not_equals(connection, null); 20 assert_not_equals(connection, null);
22 21
23 request.reconnect(connection.id).then( 22 request.reconnect(connection.id).then(
24 t.step_func_done(conn => { 23 t.step_func_done(conn => {
25 assert_true(connection === conn); 24 assert_true(connection === conn);
26 })); 25 }));
27 }); 26 });
28 }, button); 27 }, button);
29 }); 28 });
30 }, "Test that Presentation.reconnect() resolves with existing presentation conne ction."); 29 }, "Test that Presentation.reconnect() resolves with existing presentation conne ction.");
31 30
32 </script> 31 </script>
33 </body> 32 </body>
34 </html> 33 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698