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

Unified Diff: chrome/test/data/extensions/api_test/notifications/has_permission_prefs/background.js

Issue 187803005: Remove uses of the Legacy Notification API and tests on Linux Aura (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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: chrome/test/data/extensions/api_test/notifications/has_permission_prefs/background.js
diff --git a/chrome/test/data/extensions/api_test/notifications/has_permission_prefs/background.js b/chrome/test/data/extensions/api_test/notifications/has_permission_prefs/background.js
index 73e6132e44722c5723e7aa39a3ffd94dce42baad..cbd106f91be04eed026af53c2de18ec561813380 100644
--- a/chrome/test/data/extensions/api_test/notifications/has_permission_prefs/background.js
+++ b/chrome/test/data/extensions/api_test/notifications/has_permission_prefs/background.js
@@ -4,27 +4,19 @@
chrome.test.runTests([
function hasPermission() {
- chrome.test.assertEq(0, // allowed
- webkitNotifications.checkPermission());
+ chrome.test.assertEq("granted", // permission not allowed
+ Notification.permission);
chrome.test.succeed();
},
- function showHTMLNotification() {
- // createHTMLNotification is not exposed even when the web page permission
- // is granted.
- if (window.webkitNotifications.createHTMLNotification)
- chrome.test.fail("createHTMLNotification is found.");
- else
- chrome.test.succeed();
- },
function showTextNotification() {
- var notification = window.webkitNotifications.createNotification(
- "", "Foo", "This is text notification.");
+ var notification = new Notification("Foo", {
+ body: "This is a text notification."
+ });
notification.onerror = function() {
chrome.test.fail("Failed to show notification.");
};
- notification.ondisplay = function() {
+ notification.onshow = function() {
chrome.test.succeed();
};
- notification.show();
}
]);

Powered by Google App Engine
This is Rietveld 408576698