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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/notifications/resources/serviceworker-notification-event.js

Issue 2380273002: Added reply field to blink NotificationEvent (not yet piped through) (Closed)
Patch Set: Add a test for default value of notificationevent.reply Created 4 years, 2 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
OLDNEW
1 importScripts('../../serviceworker/resources/worker-testharness.js'); 1 importScripts('../../serviceworker/resources/worker-testharness.js');
2 2
3 let messagePort = null; 3 let messagePort = null;
4 addEventListener('message', workerEvent => { 4 addEventListener('message', workerEvent => {
5 messagePort = workerEvent.data; 5 messagePort = workerEvent.data;
6 messagePort.postMessage('ready'); 6 messagePort.postMessage('ready');
7 }); 7 });
8 8
9 addEventListener('notificationclick', e => runTest(e.notification)); 9 addEventListener('notificationclick', e => runTest(e.notification));
10 10
(...skipping 12 matching lines...) Expand all
23 23
24 const event = new NotificationEvent('NotificationEvent', { notification }) ; 24 const event = new NotificationEvent('NotificationEvent', { notification }) ;
25 25
26 assert_equals(event.type, 'NotificationEvent'); 26 assert_equals(event.type, 'NotificationEvent');
27 assert_idl_attribute(event, 'notification'); 27 assert_idl_attribute(event, 'notification');
28 assert_idl_attribute(event, 'action'); 28 assert_idl_attribute(event, 'action');
29 assert_equals(event.cancelable, false); 29 assert_equals(event.cancelable, false);
30 assert_equals(event.bubbles, false); 30 assert_equals(event.bubbles, false);
31 assert_equals(event.notification, notification); 31 assert_equals(event.notification, notification);
32 assert_equals(event.action, ''); 32 assert_equals(event.action, '');
33 assert_equals(event.reply, '');
33 assert_inherits(event, 'waitUntil'); 34 assert_inherits(event, 'waitUntil');
34 35
35 const customEvent = new NotificationEvent('NotificationEvent', { 36 const customEvent = new NotificationEvent('NotificationEvent', {
36 notification: notification, 37 notification: notification,
38 reply: 'my reply',
37 bubbles: true, 39 bubbles: true,
38 cancelable: true }); 40 cancelable: true });
39 41
40 assert_equals(customEvent.type, 'NotificationEvent'); 42 assert_equals(customEvent.type, 'NotificationEvent');
41 assert_equals(customEvent.cancelable, true); 43 assert_equals(customEvent.cancelable, true);
42 assert_equals(customEvent.bubbles, true); 44 assert_equals(customEvent.bubbles, true);
43 assert_equals(customEvent.notification, notification); 45 assert_equals(customEvent.notification, notification);
46 assert_equals(customEvent.reply, 'my reply');
44 } catch (e) { 47 } catch (e) {
45 result.success = false; 48 result.success = false;
46 result.message = e.message + '\n' + e.stack; 49 result.message = e.message + '\n' + e.stack;
47 } 50 }
48 // Signal to the document that the test has finished running. 51 // Signal to the document that the test has finished running.
49 messagePort.postMessage(result); 52 messagePort.postMessage(result);
50 } 53 }
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698