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

Side by Side Diff: third_party/WebKit/LayoutTests/presentation/presentationconnectionavailableevent-ctor-mock.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/mojo-helpers.js"></script> 6 <script src="../resources/mojo-helpers.js"></script>
7 <script src="resources/presentation-service-mock.js"></script> 7 <script src="resources/presentation-service-mock.js"></script>
8 <button>click me</button> 8 <button>click me</button>
9 <script> 9 <script>
10 10
11 async_test(t => { 11 async_test(t => {
12 presentationServiceMock.then(t.step_func(mockService => { 12 presentationServiceMock.then(t.step_func(mockService => {
13 var button = document.querySelector('button'); 13 const button = document.querySelector('button');
14 // This is receiving the user gesture and runs the callback. 14 // This is receiving the user gesture and runs the callback.
15 waitForClick(t.step_func(_ => { 15 waitForClick(t.step_func(_ => {
16 new PresentationRequest('https://example.com').start().then( 16 new PresentationRequest('https://example.com').start().then(
17 t.step_func_done(result => { 17 t.step_func_done(result => {
18 var e = new PresentationConnectionAvailableEvent( 18 const e = new PresentationConnectionAvailableEvent(
19 'connectionavailable', { connection: result }); 19 'connectionavailable', { connection: result });
20 assert_not_equals(e, null); 20 assert_not_equals(e, null);
21 assert_equals(e.connection, result); 21 assert_equals(e.connection, result);
22 })); 22 }));
23 }), button); 23 }), button);
24 })); 24 }));
25 }, "Test that the PresentationConnectionAvailableEvent ctor can take a valid Pre sentationConnection.") 25 }, "Test that the PresentationConnectionAvailableEvent ctor can take a valid Pre sentationConnection.")
26 26
27 </script> 27 </script>
28 </body> 28 </body>
29 </html> 29 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698