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

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

Issue 10808113: Only allows extensions to create HTML notifications. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix per feedback Created 8 years, 5 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 dd415018bac3f528dc9a2883366a881fa5fb6079..1a4ee94d7b10bae8ff4f260b0f5663b84ce19c64 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
@@ -8,10 +8,17 @@ chrome.test.runTests([
webkitNotifications.checkPermission());
chrome.test.succeed();
},
- function showNotification() {
+ 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.createHTMLNotification(
- chrome.extension.getURL("notification.html")).show();
+ window.webkitNotifications.createNotification(
+ "", "Foo", "This is text notification.").show();
} catch (e) {
chrome.test.assertTrue(e.message.indexOf("SECURITY_ERR") == 0);
chrome.test.succeed();

Powered by Google App Engine
This is Rietveld 408576698