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

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

Issue 1042513002: Add the vibrate attribute to the Notification object (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 8 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 side-by-side diff with in-line comments
Download patch
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>

Powered by Google App Engine
This is Rietveld 408576698