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 ]); |