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

Side by Side Diff: LayoutTests/http/tests/push_messaging/subscribe-success-in-document.html

Issue 1084683003: Merge the value of the push subscription id into the endpoint. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 5 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/core/frame/UseCounter.h » ('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 <head> 3 <head>
4 <title>subscribe() succeeds when permission is granted and resolves with a valid subscription</title> 4 <title>subscribe() succeeds when permission is granted and resolves with a valid subscription</title>
5 <link rel="manifest" href="resources/push_manifest.json"> 5 <link rel="manifest" href="resources/push_manifest.json">
6 <script src="../resources/testharness.js"></script> 6 <script src="../resources/testharness.js"></script>
7 <script src="../resources/testharnessreport.js"></script> 7 <script src="../resources/testharnessreport.js"></script>
8 <script src="../resources/testharness-helpers.js"></script> 8 <script src="../resources/testharness-helpers.js"></script>
9 <script src="../serviceworker/resources/test-helpers.js"></script> 9 <script src="../serviceworker/resources/test-helpers.js"></script>
10 </head> 10 </head>
(...skipping 13 matching lines...) Expand all
24 if (window.testRunner) 24 if (window.testRunner)
25 testRunner.setPermission('push-messaging', 'granted', location.o rigin, location.origin); 25 testRunner.setPermission('push-messaging', 'granted', location.o rigin, location.origin);
26 return swRegistration.pushManager.subscribe(); 26 return swRegistration.pushManager.subscribe();
27 }) 27 })
28 .then(function(pushSubscription) { 28 .then(function(pushSubscription) {
29 assert_will_be_idl_attribute(pushSubscription, 'subscriptionId'); 29 assert_will_be_idl_attribute(pushSubscription, 'subscriptionId');
30 assert_equals(typeof pushSubscription.subscriptionId, 'string'); 30 assert_equals(typeof pushSubscription.subscriptionId, 'string');
31 31
32 assert_will_be_idl_attribute(pushSubscription, 'endpoint'); 32 assert_will_be_idl_attribute(pushSubscription, 'endpoint');
33 assert_equals(typeof pushSubscription.endpoint, 'string'); 33 assert_equals(typeof pushSubscription.endpoint, 'string');
34
35 // The |subscriptionId| attribute is being deprecated, and its value
36 // is now the last part of the |endpoint| attribute.
37 assert_true(pushSubscription.endpoint.endsWith(pushSubscription.subs criptionId));
38
34 try { 39 try {
35 var endpointUrl = new URL(pushSubscription.endpoint); 40 var endpointUrl = new URL(pushSubscription.endpoint);
36 } catch(e) { 41 } catch(e) {
37 assert_unreached('Constructing a URL from the endpoint should not throw.'); 42 assert_unreached('Constructing a URL from the endpoint should no t throw.');
38 } 43 }
39 44
40 return service_worker_unregister_and_done(test, workerScope); 45 return service_worker_unregister_and_done(test, workerScope);
41 }) 46 })
42 .catch(unreached_rejection(test)); 47 .catch(unreached_rejection(test));
43 }, 'subscribe() succeeds when permission is granted and resolves with a valid su bscription'); 48 }, 'subscribe() succeeds when permission is granted and resolves with a valid su bscription');
44 </script> 49 </script>
45 </body> 50 </body>
46 </html> 51 </html>
OLDNEW
« no previous file with comments | « no previous file | Source/core/frame/UseCounter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698