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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/notifications/serviceworker-notificationclick-event-reflection.html

Issue 1417913002: Notifications: Improve SW notification property layout test (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed review nits Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/notifications/serviceworker-notification-properties.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/http/tests/notifications/serviceworker-notificationclick-event-reflection.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/notifications/serviceworker-notificationclick-event-reflection.html b/third_party/WebKit/LayoutTests/http/tests/notifications/serviceworker-notificationclick-event-reflection.html
deleted file mode 100644
index 2c7283b7ec601a6666f6c67f535dbc4d6894a6d7..0000000000000000000000000000000000000000
--- a/third_party/WebKit/LayoutTests/http/tests/notifications/serviceworker-notificationclick-event-reflection.html
+++ /dev/null
@@ -1,87 +0,0 @@
-<!doctype html>
-<html>
- <head>
- <title>Notifications: Property reflection in the "notificationclick" event.</title>
- <script src="../resources/testharness.js"></script>
- <script src="../resources/testharnessreport.js"></script>
- <script src="../serviceworker/resources/test-helpers.js"></script>
- <script src="resources/test-helpers.js"></script>
- </head>
- <body>
- <script>
- // Tests that the notification available in the "notificationclick" event in the
- // Service Worker accurately reflects the attributes with which the notification
- // was created (for this test --) in the document.
-
- async_test(function(test) {
- var scope = 'resources/scope/' + location.pathname,
- script = 'resources/instrumentation-service-worker.js';
-
- var options = {
- title: scope,
- dir: 'rtl',
- lang: 'nl-NL',
- body: 'Hello, world!',
- tag: 'tag',
- // FIXME: Relative URLs for the icon attribute currently get reflected as
- // an absolute URL, which should probably be the given relative URL.
- icon: 'https://example/icon.png',
- vibrate: [100, 200, 300],
- silent: false,
- requireInteraction: true,
- data: [
- { property: 'foobar',
- string: '\uDFFF\u0000\uDBFF',
- scalar: true },
- 12.15
- ],
- actions: [{ action: 'one', title: 'Action 1' },
- { action: 'two', title: 'Action 2' },
- { action: 'three', title: 'Action 3' }]
- };
-
- testRunner.setPermission('notifications', 'granted', location.origin, location.origin);
- getActiveServiceWorkerWithMessagePort(test, script, scope).then(function(workerInfo) {
- // (1) Tell the Service Worker to display a Web Notification.
- workerInfo.port.postMessage({
- command: 'show',
-
- title: scope,
- options: options
- });
-
- workerInfo.port.addEventListener('message', function(event) {
- if (typeof event.data != 'object' || !event.data.command) {
- assert_unreached('Invalid message from the Service Worker.');
- return;
- }
-
- // (2) Listen for confirmation from the Service Worker that the
- // notification's display promise has been resolved.
- if (event.data.command == 'show') {
- assert_true(event.data.success, 'The notification must have been displayed.');
- testRunner.simulateWebNotificationClick(scope);
- return;
- }
-
- // (3) Listen for confirmation from the Service Worker that the
- // notification has been clicked on. Make sure that all properties
- // set on the Notification object are as expected.
- assert_equals(event.data.command, 'click', 'The notification was expected to be clicked.');
-
- options.actions = options.actions.slice(0, Notification.maxActions);
- Object.keys(options).forEach(function(key) {
- if (typeof options[key] == 'object')
- assert_object_equals(event.data.notification[key], options[key], 'The ' + key + ' field must be the same.');
- else
- assert_equals(event.data.notification[key], options[key], 'The ' + key + ' field must be the same.');
- });
-
- test.done();
- });
- }).catch(unreached_rejection(test));
-
- }, 'Clicking on a notification displayed by a Service Worker the notificationclick event.');
- </script>
- </body>
-</html>
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/notifications/serviceworker-notification-properties.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698