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

Side by Side Diff: third_party/WebKit/LayoutTests/presentation/presentationrequest.html

Issue 2572473003: [Presentation API] PresentationRequest::getAvailability() should return the same promise (Closed)
Patch Set: rebase with master Created 4 years 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/BUILD.gn » ('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/gc.js"></script> 6 <script src="../resources/gc.js"></script>
7 <script> 7 <script>
8 8
9 async_test(function(t) { 9 async_test(function(t) {
10 var request = new PresentationRequest("http://example.com"); 10 var request = new PresentationRequest("http://example.com");
11 request.start().catch(t.step_func(function(e) { 11 request.start().catch(t.step_func(function(e) {
12 assert_true(e instanceof DOMException); 12 assert_true(e instanceof DOMException);
13 assert_equals(e.name, "InvalidAccessError"); 13 assert_equals(e.name, "InvalidAccessError");
14 assert_equals(e.message, "PresentationRequest::start() requires user gesture ."); 14 assert_equals(e.message, "PresentationRequest::start() requires user gesture .");
15 t.done(); 15 t.done();
16 })); 16 }));
17 }, "Test that the PresentationRequest.start() requires user gesture.") 17 }, "Test that the PresentationRequest.start() requires user gesture.")
18 18
19 test(function() { 19 test(function() {
20 navigator.presentation.defaultRequest = new PresentationRequest("http://exampl e.com"); 20 navigator.presentation.defaultRequest = new PresentationRequest("http://exampl e.com");
21 navigator.presentation.defaultRequest.onconnectionavailable = function() { }; 21 navigator.presentation.defaultRequest.onconnectionavailable = function() { };
22 gc(); 22 gc();
23 assert_not_equals(navigator.presentation.defaultRequest.onconnectionavailable, undefined); 23 assert_not_equals(navigator.presentation.defaultRequest.onconnectionavailable, undefined);
24 }, "Test that navigator.presentation.defaultRequest.onconnectionavailable isn't reset after gc()"); 24 }, "Test that navigator.presentation.defaultRequest.onconnectionavailable isn't reset after gc()");
25 25
26 test(function() {
27 var request = new PresentationRequest("http://example.com");
28 var promise_1 = request.getAvailability();
29 var promise_2 = request.getAvailability();
30 assert_true(promise_1 === promise_2);
31 }, "Test that the PresentationRequest.getAvailability() returns same promise obj ect.");
32
26 </script> 33 </script>
27 </body> 34 </body>
28 </html> 35 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/presentation/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698