Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / notifications / serviceworkerregistration-document-vibrate-throw.html
blob7cf8317a9d27d38337720424ea845448b4c84c5a
1 <!doctype html>
2 <html>
3 <head>
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>
6 <script src="../resources/testharnessreport.js"></script>
7 <script src="../serviceworker/resources/test-helpers.js"></script>
8 </head>
9 <body>
10 <script>
11 // Tests that the showNotification() function rejects the returned promise with a
12 // TypeError when silent set true and vibrate is presented.
13 async_test(function(test) {
14 var scope = 'resources/scope/' + location.pathname,
15 workerUrl = 'resources/empty-worker.js';
17 testRunner.setPermission('notifications', 'granted', location.origin, location.origin);
19 var registration = null;
20 service_worker_unregister_and_register(test, workerUrl, scope).then(function(swRegistration) {
21 registration = swRegistration;
22 return wait_for_state(test, registration.installing, 'activated');
23 }).then(function() {
24 registration.showNotification('Title', {
25 body: 'Hello, world!',
26 vibrate: [100, 200, 300],
27 silent: true
28 }).then(function() {
29 assert_unreached('showNotification() is expected to reject.');
30 }).catch(function(error) {
31 assert_equals(error.name, 'TypeError');
32 assert_equals(error.message, "Failed to execute 'showNotification' on 'ServiceWorkerRegistration': Silent notifications must not specify vibration patterns.");
33 test.done();
34 });
36 }).catch(unreached_rejection(test));
38 }, 'showNotification() must reject If options\'s silent is true, and options\'s vibrate is presenteded.');
39 </script>
40 </body>
41 </html>