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

Side by Side Diff: LayoutTests/http/tests/notifications/serviceworkerregistration-document-vibrate-throw.html

Issue 1260793007: Generalize validation of developer input for Web Notifications (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 4 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
OLDNEW
1 <!doctype html> 1 <!doctype html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <title>Notifications: Verifying the exception throwing behavior, when silent set true and vibrate is presented in showNotification().</title> 4 <title>Notifications: Verifying the exception throwing behavior, when silent set true and vibrate is presented in showNotification().</title>
5 <script src="../resources/testharness.js"></script> 5 <script src="../resources/testharness.js"></script>
6 <script src="../resources/testharnessreport.js"></script> 6 <script src="../resources/testharnessreport.js"></script>
7 <script src="../serviceworker/resources/test-helpers.js"></script> 7 <script src="../serviceworker/resources/test-helpers.js"></script>
8 </head> 8 </head>
9 <body> 9 <body>
10 <script> 10 <script>
(...skipping 11 matching lines...) Expand all
22 return wait_for_state(test, registration.installing, 'activated'); 22 return wait_for_state(test, registration.installing, 'activated');
23 }).then(function() { 23 }).then(function() {
24 registration.showNotification('Title', { 24 registration.showNotification('Title', {
25 body: 'Hello, world!', 25 body: 'Hello, world!',
26 vibrate: [100, 200, 300], 26 vibrate: [100, 200, 300],
27 silent: true 27 silent: true
28 }).then(function() { 28 }).then(function() {
29 assert_unreached('showNotification() is expected to reject.'); 29 assert_unreached('showNotification() is expected to reject.');
30 }).catch(function(error) { 30 }).catch(function(error) {
31 assert_equals(error.name, 'TypeError'); 31 assert_equals(error.name, 'TypeError');
32 assert_equals(error.message, 'Silent notifications must not sp ecify vibration patterns.'); 32 assert_equals(error.message, "Failed to execute 'showNotificat ion' on 'ServiceWorkerRegistration': Silent notifications must not specify vibra tion patterns.");
33 test.done(); 33 test.done();
34 }); 34 });
35 35
36 }).catch(unreached_rejection(test)); 36 }).catch(unreached_rejection(test));
37 37
38 }, 'showNotification() must reject If options\'s silent is true, and optio ns\'s vibrate is presenteded.'); 38 }, 'showNotification() must reject If options\'s silent is true, and optio ns\'s vibrate is presenteded.');
39 </script> 39 </script>
40 </body> 40 </body>
41 </html> 41 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698