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

Unified Diff: chrome/test/data/extensions/api_test/notification_provider/basic_usage/background.js

Issue 468813002: Add NotifyOnPermissionLevelChanged implementation of notification (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 4 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 | « chrome/browser/extensions/api/notification_provider/notification_provider_api.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/extensions/api_test/notification_provider/basic_usage/background.js
diff --git a/chrome/test/data/extensions/api_test/notification_provider/basic_usage/background.js b/chrome/test/data/extensions/api_test/notification_provider/basic_usage/background.js
index f62df7753cf55bba8317df70e066ad13090373fe..39e50d551bdb166c60f1e77a3d23f25f7ed67dce 100644
--- a/chrome/test/data/extensions/api_test/notification_provider/basic_usage/background.js
+++ b/chrome/test/data/extensions/api_test/notification_provider/basic_usage/background.js
@@ -160,6 +160,26 @@ function testNotifyOnClosed() {
.catch(function() { failTest("NotifyOnCleared"); });
}
+function testNotifyOnPermissionLevelChanged() {
+ chrome.notifications.onPermissionLevelChanged.addListener(function(level) {
+ chrome.test.succeed();
+ });
+
+ // Create a notification, so there will be one existing notification.
+ createNotification(id1, content)
+ .catch(function() { failTest("notifications.create"); })
+ // Try to notify a web type notifier its permissional level is changed.
+ .then(function() { return notifyOnPermissionLevelChanged("SomeURL",
+ "web",
+ "granted"); })
+ .then(function() { failTest("NotifyOnPermissionLevelChanged"); })
+ // Notify that the permission level of current notifier is changed.
+ .catch(function () { return notifyOnPermissionLevelChanged(myId,
+ "application",
+ "granted"); })
+ .catch(function() { failTest("NotifyOnPermissionLevelChanged"); });
+}
+
function testNotifyOnShowSettings() {
chrome.notifications.onShowSettings.addListener(function() {
chrome.test.succeed();
@@ -175,10 +195,11 @@ function testNotifyOnShowSettings() {
.then(function() { failTest("NotifyOnShowSettings"); })
// Notify current notifier that a user checked its settings.
.catch(function () { return notifyOnShowSettings(myId, "application"); })
- .catch(function() { failTest("NotifyOnShowSettings"); })
+ .catch(function() { failTest("NotifyOnShowSettings"); });
}
chrome.test.runTests([ testNotifyOnClicked,
testNotifyOnButtonClicked,
testNotifyOnClosed,
+ testNotifyOnPermissionLevelChanged,
testNotifyOnShowSettings ]);
« no previous file with comments | « chrome/browser/extensions/api/notification_provider/notification_provider_api.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698