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

Unified Diff: chrome/test/data/extensions/api_test/notifications/has_not_permission/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_not_permission/background.js
diff --git a/chrome/test/data/extensions/api_test/notifications/has_not_permission/background.js b/chrome/test/data/extensions/api_test/notifications/has_not_permission/background.js
index dbc2f1f9c38590d378d3c1f230c20842ee850648..4690f5230501d8614961c89fcd5f43b78e1aa771 100644
--- a/chrome/test/data/extensions/api_test/notifications/has_not_permission/background.js
+++ b/chrome/test/data/extensions/api_test/notifications/has_not_permission/background.js
@@ -4,26 +4,19 @@
chrome.test.runTests([
function hasPermission() {
- chrome.test.assertEq(1, // permission not allowed
- webkitNotifications.checkPermission());
+ chrome.test.assertEq("default", // permission not granted
+ Notification.permission);
chrome.test.succeed();
},
- function showHTMLNotification() {
- // createHTMLNotification should not be exposed.
- if (window.webkitNotifications.createHTMLNotification)
- chrome.test.fail("createHTMLNotification is found.");
- else
- chrome.test.succeed();
- },
function showTextNotification() {
- try {
- window.webkitNotifications.createNotification(
- "", "Foo", "This is text notification.").show();
- } catch (e) {
- chrome.test.assertEq("SecurityError", e.name);
+ var notification = new Notification("Foo", {
+ body: "This is a text notification."
+ });
+ notification.onerror = function() {
chrome.test.succeed();
- return;
- }
- chrome.test.fail("Expected access denied error.");
+ };
+ notification.onshow = function() {
+ chrome.test.fail("Displayed a notification without permission.");
+ };
}
]);

Powered by Google App Engine
This is Rietveld 408576698