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

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

Issue 2691773002: [Presentation API] Remove state transition from PresentationConnection::take() (Closed)
Patch Set: update layout test to check initial state of presentation connection 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/presentation/PresentationConnection.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 var button = document.querySelector('button'); 11 var button = document.querySelector('button');
12 12
13 var testPresentationRequestStart = function(t, requestArgument, connectionUrl) { 13 var testPresentationRequestStart = function(t, requestArgument, connectionUrl) {
14 presentationServiceMock.then(service => { 14 presentationServiceMock.then(service => {
15 // This is receiving the user gesture and runs the callback. 15 // This is receiving the user gesture and runs the callback.
16 waitForClick(() => { 16 waitForClick(() => {
17 new PresentationRequest(requestArgument).start().then( 17 new PresentationRequest(requestArgument).start().then(
18 t.step_func_done(connection => { 18 t.step_func_done(connection => {
19 assert_equals(connection.url, connectionUrl); 19 assert_equals(connection.url, connectionUrl);
20 assert_equals(connection.state, 'connecting');
20 })); 21 }));
21 }, button); 22 }, button);
22 }); 23 });
23 }; 24 };
24 25
25 async_test(t => { 26 async_test(t => {
26 var presentationUrl = "http://example.com/example.html"; 27 var presentationUrl = "http://example.com/example.html";
27 testPresentationRequestStart(t, presentationUrl, presentationUrl); 28 testPresentationRequestStart(t, presentationUrl, presentationUrl);
28 }, "Test that the PresentationRequest.start() with single URL resolves with corr ect PresentationConnection object."); 29 }, "Test that the PresentationRequest.start() with single URL resolves with corr ect PresentationConnection object.");
29 30
30 async_test(t => { 31 async_test(t => {
31 var presentationUrls = ["http://example.com/example.html", "cast://google.com/ app_id=deadbeef"]; 32 var presentationUrls = ["http://example.com/example.html", "cast://google.com/ app_id=deadbeef"];
32 testPresentationRequestStart(t, presentationUrls, presentationUrls[0]); 33 testPresentationRequestStart(t, presentationUrls, presentationUrls[0]);
33 }, "Test that the PresentationRequest.start() with multiple URLs resolves with c orrect PresentationConnection object."); 34 }, "Test that the PresentationRequest.start() with multiple URLs resolves with c orrect PresentationConnection object.");
34 35
35 async_test(t => { 36 async_test(t => {
36 var presentationUrl = "http://example.com/\ud801/example.html"; 37 var presentationUrl = "http://example.com/\ud801/example.html";
37 var connectionUrl = "http://example.com/" + encodeURIComponent('\ufffd') + "/e xample.html" 38 var connectionUrl = "http://example.com/" + encodeURIComponent('\ufffd') + "/e xample.html"
38 39
39 testPresentationRequestStart(t, presentationUrl, connectionUrl); 40 testPresentationRequestStart(t, presentationUrl, connectionUrl);
40 }, "Test that the PresentationRequest.start() with single URL containing special symbol resolves with correct PresentationConnection object."); 41 }, "Test that the PresentationRequest.start() with single URL containing special symbol resolves with correct PresentationConnection object.");
41 42
42 </script> 43 </script>
43 </body> 44 </body>
44 </html> 45 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/presentation/PresentationConnection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698