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

Unified Diff: chrome/test/data/extensions/api_test/content_settings/standard/test.html

Issue 7298005: Expose privacy-relevant preferences via Chrome's extension API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Strawman #2 for discussion. Created 9 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/content_settings/standard/test.html
diff --git a/chrome/test/data/extensions/api_test/content_settings/standard/test.html b/chrome/test/data/extensions/api_test/content_settings/standard/test.html
index 9249024bbfdaacfc8ea5ab6ea4b918f62fc4e00b..34669888ab63e265920dceb8c7829055e0ec0935 100644
--- a/chrome/test/data/extensions/api_test/content_settings/standard/test.html
+++ b/chrome/test/data/extensions/api_test/content_settings/standard/test.html
@@ -24,12 +24,27 @@ var settings = {
"notifications": "block"
};
+var globalFixtures = {
+ "alternateErrorPagesEnabled": "Alternate error pages should be disabled.",
+ "autofillEnabled": "Autofill should be disabled.",
+ "clearSiteDataOnExit": "Clearing site data should be disabled.",
+ "hyperlinkAuditingEnabled": "<a ping> should be disabled.",
+ "instantEnabled": "Instant should be disabled.",
+ "networkPredictionEnabled": "Network prediction should be disabled.",
+ "referrersEnabled": "Referrers should be disabled.",
+ "safeBrowsingEnabled": "Safe browsing should be disabled.",
+ "searchSuggestEnabled": "Suggest should be disabled.",
+ "thirdPartyCookiesAllowed": "Third party cookies should be blocked.",
+ "translateEnabled": "Translate should be disabled."
+};
+
Object.prototype.forEach = function(f) {
- for (key in this) {
- if (this.hasOwnProperty(key))
- f(key, this[key]);
+ var k;
+ for (k in this) {
+ if (this.hasOwnProperty(k))
+ f(k, this[k]);
}
-}
+};
function expect(expected, message) {
@@ -37,30 +52,24 @@ function expect(expected, message) {
chrome.test.assertEq(expected, value, message);
});
}
+
+function expectFalse(message) {
+ return expect({
+ "value": false,
+ "levelOfControl": "controllable_by_this_extension"
+ }, message);
+}
+
chrome.test.runTests([
- function getThirdPartyCookiesAllowed() {
- cs.global.thirdPartyCookiesAllowed.get(
- {},
- expect({ 'value': false,
- 'levelOfControl': "controllable_by_this_extension" },
- "third-party cookies should be blocked"));
- },
- function getReferrersEnabled() {
- cs.global.referrersEnabled.get(
- {},
- expect({ 'value': false,
- 'levelOfControl': "controllable_by_this_extension" },
- "referrers should be disabled"));
- },
- function setThirdPartyCookiesAllowed() {
- cs.global.thirdPartyCookiesAllowed.set(
- {'value': true},
- chrome.test.callbackPass());
+ function getGlobals() {
+ globalFixtures.forEach(function (pref, message) {
+ cs.global[pref].get({}, expectFalse(message));
Bernhard Bauer 2011/07/27 11:41:34 These prefs are not in global anymore.
Mike West 2011/07/27 11:48:01 Lots of ContentSettings tests are broken in this C
+ });
},
- function setReferrersEnabled() {
- cs.global.referrersEnabled.set(
- {'value': true},
- chrome.test.callbackPass());
+ function setGlobals() {
+ globalFixtures.forEach(function (pref) {
+ cs.global[pref].set({'value': true}, chrome.test.callbackPass());
+ });
},
function setDefaultContentSettings() {
default_content_settings.forEach(function(type, setting) {
@@ -91,7 +100,7 @@ chrome.test.runTests([
},
function invalidSettings() {
cs.cookies.get({
- 'primaryUrl': 'moo',
+ 'primaryUrl': 'moo'
}, chrome.test.callbackFail("The URL \"moo\" is invalid."));
cs.plugins.set({
'primaryPattern': 'http://example.com/*',

Powered by Google App Engine
This is Rietveld 408576698