Chromium Code Reviews| Index: LayoutTests/http/tests/notifications/serviceworkerregistration-document-vibrate-throw.html |
| diff --git a/LayoutTests/http/tests/notifications/serviceworkerregistration-document-no-permission.html b/LayoutTests/http/tests/notifications/serviceworkerregistration-document-vibrate-throw.html |
| similarity index 61% |
| copy from LayoutTests/http/tests/notifications/serviceworkerregistration-document-no-permission.html |
| copy to LayoutTests/http/tests/notifications/serviceworkerregistration-document-vibrate-throw.html |
| index 2633bd6aaabc30be330e3dc6e758e7f695b2583c..4d09bdaf6f670c811addd01f9f3d45d65d04b1ea 100644 |
| --- a/LayoutTests/http/tests/notifications/serviceworkerregistration-document-no-permission.html |
| +++ b/LayoutTests/http/tests/notifications/serviceworkerregistration-document-vibrate-throw.html |
| @@ -1,7 +1,7 @@ |
| <!doctype html> |
| <html> |
| <head> |
| - <title>Notifications: ServiceWorkerRegistration.showNotification().</title> |
| + <title>Notifications: Verifying the exception throwing behavior, when slient set true and vibrate is presented in showNotification().</title> |
| <script src="../resources/testharness.js"></script> |
| <script src="../resources/testharnessreport.js"></script> |
| <script src="../serviceworker/resources/test-helpers.js"></script> |
| @@ -9,34 +9,33 @@ |
| <body> |
| <script> |
| // Tests that the showNotification() function rejects the returned promise with a |
| - // TypeError when no permission has been granted for Web Notifications. |
| + // TypeError when slient set true and vibrate is presented. |
| async_test(function(test) { |
| - var scope = 'resources/scope/service-worker-show-notification-no-permission', |
| + var scope = 'resources/spec/' + location.pathname, |
|
Peter Beverloo
2015/04/07 11:37:31
why /spec/?
Sanghyun Park
2015/04/08 08:00:02
This is my fault.
I'll update to scope.
|
| workerUrl = 'resources/empty-worker.js'; |
| - if (window.testRunner) |
| - testRunner.grantWebNotificationPermission(location.origin, false); |
| + testRunner.grantWebNotificationPermission(location.origin, true); |
| var registration = null; |
| service_worker_unregister_and_register(test, workerUrl, scope).then(function(swRegistration) { |
| registration = swRegistration; |
| return wait_for_state(test, registration.installing, 'activated'); |
| }).then(function() { |
| - assert_inherits(registration, 'showNotification', 'showNotification() must be exposed.'); |
| registration.showNotification('Title', { |
| body: 'Hello, world!', |
| - icon: '/icon.png' |
| + vibrate: [100, 200, 300], |
| + silent: true |
| }).then(function() { |
| assert_unreached('showNotification() is expected to reject.'); |
| }).catch(function(error) { |
| assert_equals(error.name, 'TypeError'); |
| - assert_equals(error.message, 'No notification permission has been granted for this origin.'); |
| + assert_equals(error.message, 'If options\'s silent is true, options\'s vibrate should not be presented.'); |
|
Peter Beverloo
2015/04/07 11:37:31
"If options's silent is true, options's vibrate sh
Sanghyun Park
2015/04/08 08:00:02
Okay, I'll update.
Sanghyun Park
2015/04/08 16:37:58
This error.message should be same with throwTypeEr
Peter Beverloo
2015/04/08 16:40:01
SGTM
|
| test.done(); |
| }); |
| }).catch(unreached_rejection(test)); |
| - }, 'showNotification() must reject if no Web Notification permission has been granted.'); |
| + }, 'showNotification() must reject If options\'s silent is true, and options\'s vibrate is presenteded.'); |
| </script> |
| </body> |
| </html> |