| Index: chrome/test/data/push_messaging/service_worker.js
|
| diff --git a/chrome/test/data/push_messaging/service_worker.js b/chrome/test/data/push_messaging/service_worker.js
|
| index 3633517343532b8355f70ac6a531a641c5cd041c..5366ce47422c47aee88953c2018f8e2c2c3052b0 100644
|
| --- a/chrome/test/data/push_messaging/service_worker.js
|
| +++ b/chrome/test/data/push_messaging/service_worker.js
|
| @@ -3,18 +3,13 @@
|
| // found in the LICENSE file.
|
|
|
| this.onpush = function(event) {
|
| - // TODO(peter): Remove this check once Blink supports PushMessageData.json().
|
| - var data = event.data;
|
| - if (typeof data !== 'string')
|
| - data = data.text();
|
| -
|
| + var data = event.data.text();
|
| if (data !== 'shownotification') {
|
| sendMessageToClients('push', data);
|
| return;
|
| }
|
|
|
| - // TODO(peter): Switch to self.registration.showNotification once implemented.
|
| - event.waitUntil(showLegacyNonPersistentNotification('Push test title', {
|
| + event.waitUntil(registration.showNotification('Push test title', {
|
| body: 'Push test body',
|
| tag: 'push_test_tag'
|
| }).then(function(notification) {
|
| @@ -37,11 +32,3 @@ function sendMessageToClients(type, data) {
|
| console.log(error);
|
| });
|
| }
|
| -
|
| -function showLegacyNonPersistentNotification(title, options) {
|
| - return new Promise(function(resolve, reject) {
|
| - var notification = new Notification(title, options);
|
| - notification.onshow = function() { resolve(notification); };
|
| - notification.onerror = function() { reject(new Error('Failed to show')); };
|
| - });
|
| -}
|
|
|