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..370217ce675845b93c5713cde070ce01d6a6881b 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 silent 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 silent set true and vibrate is presented. |
async_test(function(test) { |
- var scope = 'resources/scope/service-worker-show-notification-no-permission', |
+ var scope = 'resources/scope/' + location.pathname, |
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, 'Silent notifications must not specify vibration patterns.'); |
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> |