diff options
author | bauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-02 18:09:07 +0000 |
---|---|---|
committer | bauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-02 18:09:07 +0000 |
commit | c9471eabfabc96a43afcbef3d394fdb2657206c9 (patch) | |
tree | cb4f627e6d51382a69c1ef068170f116a97c335a | |
parent | 56d4600b883fbc3d6b4fbf37ee1545de3321eed9 (diff) | |
download | chromium_src-c9471eabfabc96a43afcbef3d394fdb2657206c9.zip chromium_src-c9471eabfabc96a43afcbef3d394fdb2657206c9.tar.gz chromium_src-c9471eabfabc96a43afcbef3d394fdb2657206c9.tar.bz2 |
Extension API: Rename contentSettings.misc to .global and rename preferences under it.
BUG=71067
Review URL: http://codereview.chromium.org/7031063
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@87632 0039d316-1c4b-4281-b951-d872f2087c98
13 files changed, 140 insertions, 121 deletions
diff --git a/chrome/browser/extensions/extension_preference_api.cc b/chrome/browser/extensions/extension_preference_api.cc index ae65a58..bfc4f50 100644 --- a/chrome/browser/extensions/extension_preference_api.cc +++ b/chrome/browser/extensions/extension_preference_api.cc @@ -58,15 +58,15 @@ const char kPermissionErrorMessage[] = "Be sure to declare in your manifest what permissions you need."; PrefMappingEntry kPrefMapping[] = { - { "blockThirdPartyCookies", + { "thirdPartyCookiesAllowed", prefs::kBlockThirdPartyCookies, Extension::kContentSettingsPermission }, - { "enableReferrers", + { "referrersEnabled", prefs::kEnableReferrers, Extension::kContentSettingsPermission }, - { "enableHyperlinkAuditing", + { "hyperlinkAuditingEnabled", prefs::kEnableHyperlinkAuditing, Extension::kContentSettingsPermission }, @@ -78,9 +78,6 @@ PrefMappingEntry kPrefMapping[] = { class IdentityPrefTransformer : public PrefTransformerInterface { public: - IdentityPrefTransformer() { } - virtual ~IdentityPrefTransformer() { } - virtual Value* ExtensionToBrowserPref(const Value* extension_pref, std::string* error, bool* bad_message) { @@ -92,6 +89,27 @@ class IdentityPrefTransformer : public PrefTransformerInterface { } }; +class InvertBooleanTransformer : public PrefTransformerInterface { + public: + virtual Value* ExtensionToBrowserPref(const Value* extension_pref, + std::string* error, + bool* bad_message) { + return InvertBooleanValue(extension_pref); + } + + virtual Value* BrowserToExtensionPref(const Value* browser_pref) { + return InvertBooleanValue(browser_pref); + } + + private: + static Value* InvertBooleanValue(const Value* value) { + bool bool_value = false; + bool result = value->GetAsBoolean(&bool_value); + DCHECK(result); + return Value::CreateBooleanValue(!bool_value); + } +}; + // Returns a string constant (defined in the API) indicating the level of // control this extension has over the specified preference. const char* GetLevelOfControl( @@ -190,6 +208,8 @@ class PrefMapping { DCHECK_EQ(arraysize(kPrefMapping), mapping_.size()); DCHECK_EQ(arraysize(kPrefMapping), event_mapping_.size()); RegisterPrefTransformer(prefs::kProxy, new ProxyPrefTransformer()); + RegisterPrefTransformer(prefs::kBlockThirdPartyCookies, + new InvertBooleanTransformer()); } ~PrefMapping() { diff --git a/chrome/common/extensions/api/extension_api.json b/chrome/common/extensions/api/extension_api.json index 17c229c..24dd757 100644 --- a/chrome/common/extensions/api/extension_api.json +++ b/chrome/common/extensions/api/extension_api.json @@ -5653,22 +5653,22 @@ ] }, { - "namespace": "experimental.contentSettings.misc", + "namespace": "experimental.contentSettings.global", "properties": { - "blockThirdPartyCookies": { + "thirdPartyCookiesAllowed": { "$ref": "Preference", - "value": ["blockThirdPartyCookies", {"type": "boolean"}], - "description": "Whether third party cookies should be blocked. The value of this preference is of type boolean." + "value": ["thirdPartyCookiesAllowed", {"type": "boolean"}], + "description": "Whether third party cookies should be allowed. The value of this preference is of type boolean, and the default value is true." }, - "enableReferrers": { + "referrersEnabled": { "$ref": "Preference", - "value": ["enableReferrers", {"type":"boolean"}], - "description": "Whether referrers should be enabled. The value of this preference is of type boolean." + "value": ["referrersEnabled", {"type":"boolean"}], + "description": "Whether referrers should be enabled. The value of this preference is of type boolean, and the default value is true." }, - "enableHyperlinkAuditing": { + "hyperlinkAuditingEnabled": { "$ref": "Preference", - "value": ["enableHyperlinkAuditing", {"type":"boolean"}], - "description": "Whether to enable hyperlink auditing (\"<a ping>\"). The value of this preference is of type boolean." + "value": ["hyperlinkAuditingEnabled", {"type":"boolean"}], + "description": "Whether to enable hyperlink auditing (\"<a ping>\"). The value of this preference is of type boolean, and the default value is true." } } }, diff --git a/chrome/common/extensions/docs/examples/api/preferences/enableReferrer.zip b/chrome/common/extensions/docs/examples/api/preferences/enableReferrer.zip Binary files differindex 651e196..1f4b896 100644 --- a/chrome/common/extensions/docs/examples/api/preferences/enableReferrer.zip +++ b/chrome/common/extensions/docs/examples/api/preferences/enableReferrer.zip diff --git a/chrome/common/extensions/docs/examples/api/preferences/enableReferrer/popup.html b/chrome/common/extensions/docs/examples/api/preferences/enableReferrer/popup.html index 59255630..dd53501 100644 --- a/chrome/common/extensions/docs/examples/api/preferences/enableReferrer/popup.html +++ b/chrome/common/extensions/docs/examples/api/preferences/enableReferrer/popup.html @@ -2,8 +2,7 @@ <html> <head> <script> -var cs = chrome.experimental.contentSettings; -var pref = cs.misc.enableReferrers; +var pref = chrome.experimental.contentSettings.global.referrersEnabled; /** * Returns whether the |levelOfControl| means that the extension can change the diff --git a/chrome/common/extensions/docs/experimental.contentSettings.misc.html b/chrome/common/extensions/docs/experimental.contentSettings.global.html index dd42a43..adf7b45 100644 --- a/chrome/common/extensions/docs/experimental.contentSettings.misc.html +++ b/chrome/common/extensions/docs/experimental.contentSettings.global.html @@ -16,7 +16,7 @@ <script type="text/javascript" src="js/api_page_generator.js"></script> <script type="text/javascript" src="js/bootstrap.js"></script> <script type="text/javascript" src="js/sidebar.js"></script> - <title>chrome.experimental.contentSettings.misc - Google Chrome Extensions - Google Code</title></head> + <title>chrome.experimental.contentSettings.global - Google Chrome Extensions - Google Code</title></head> <body> <div id="gc-container" class="labs"> <div id="devModeWarning"> You are viewing extension docs in chrome via the 'file:' scheme: are you expecting to see local changes when you refresh? You'll need run chrome with --allow-file-access-from-files. @@ -251,7 +251,7 @@ <div class="g-unit" id="gc-pagecontent"> <div id="pageTitle"> - <h1 class="page_title">chrome.experimental.contentSettings.misc</h1> + <h1 class="page_title">chrome.experimental.contentSettings.global</h1> </div> <!-- TABLE OF CONTENTS --> <div id="toc"> @@ -266,17 +266,17 @@ </ol> </li> <li> - <a href="#apiReference">API reference: chrome.experimental.contentSettings.misc</a> + <a href="#apiReference">API reference: chrome.experimental.contentSettings.global</a> <ol> <li> <a href="#properties">Properties</a> <ol> <li> - <a href="#property-blockThirdPartyCookies">blockThirdPartyCookies</a> + <a href="#property-thirdPartyCookiesAllowed">thirdPartyCookiesAllowed</a> </li><li> - <a href="#property-enableReferrers">enableReferrers</a> + <a href="#property-referrersEnabled">referrersEnabled</a> </li><li> - <a href="#property-enableHyperlinkAuditing">enableHyperlinkAuditing</a> + <a href="#property-hyperlinkAuditingEnabled">hyperlinkAuditingEnabled</a> </li> </ol> </li> @@ -321,7 +321,7 @@ <!-- API PAGE --> <div class="apiPage"> <a name="apiReference"></a> - <h2>API reference: chrome.experimental.contentSettings.misc</h2> + <h2>API reference: chrome.experimental.contentSettings.global</h2> <!-- PROPERTIES --> <div class="apiGroup"> @@ -329,15 +329,15 @@ <h3 id="properties">Properties</h3> <div> - <a name="property-blockThirdPartyCookies"></a> - <h4>blockThirdPartyCookies</h4> + <a name="property-thirdPartyCookiesAllowed"></a> + <h4>thirdPartyCookiesAllowed</h4> <div class="summary"> <!-- Note: intentionally longer 80 columns --> - <span>chrome.experimental.contentSettings.misc.</span><span>blockThirdPartyCookies</span> + <span>chrome.experimental.contentSettings.global.</span><span>thirdPartyCookiesAllowed</span> </div> <div> <dt> - <var>blockThirdPartyCookies</var> + <var>thirdPartyCookiesAllowed</var> <em> <!-- TYPE --> @@ -365,7 +365,7 @@ <dd class="todo" style="display: none; "> Undocumented. </dd> - <dd>Whether third party cookies should be blocked. The value of this preference is of type boolean.</dd> + <dd>Whether third party cookies should be allowed. The value of this preference is of type boolean, and the default value is true.</dd> <dd style="display: none; "> This parameter was added in version <b><span></span></b>. @@ -403,15 +403,15 @@ </div> </div><div> - <a name="property-enableReferrers"></a> - <h4>enableReferrers</h4> + <a name="property-referrersEnabled"></a> + <h4>referrersEnabled</h4> <div class="summary"> <!-- Note: intentionally longer 80 columns --> - <span>chrome.experimental.contentSettings.misc.</span><span>enableReferrers</span> + <span>chrome.experimental.contentSettings.global.</span><span>referrersEnabled</span> </div> <div> <dt> - <var>enableReferrers</var> + <var>referrersEnabled</var> <em> <!-- TYPE --> @@ -439,7 +439,7 @@ <dd class="todo" style="display: none; "> Undocumented. </dd> - <dd>Whether referrers should be enabled. The value of this preference is of type boolean.</dd> + <dd>Whether referrers should be enabled. The value of this preference is of type boolean, and the default value is true.</dd> <dd style="display: none; "> This parameter was added in version <b><span></span></b>. @@ -477,15 +477,15 @@ </div> </div><div> - <a name="property-enableHyperlinkAuditing"></a> - <h4>enableHyperlinkAuditing</h4> + <a name="property-hyperlinkAuditingEnabled"></a> + <h4>hyperlinkAuditingEnabled</h4> <div class="summary"> <!-- Note: intentionally longer 80 columns --> - <span>chrome.experimental.contentSettings.misc.</span><span>enableHyperlinkAuditing</span> + <span>chrome.experimental.contentSettings.global.</span><span>hyperlinkAuditingEnabled</span> </div> <div> <dt> - <var>enableHyperlinkAuditing</var> + <var>hyperlinkAuditingEnabled</var> <em> <!-- TYPE --> @@ -513,7 +513,7 @@ <dd class="todo" style="display: none; "> Undocumented. </dd> - <dd>Whether to enable hyperlink auditing ("<a ping>"). The value of this preference is of type boolean.</dd> + <dd>Whether to enable hyperlink auditing ("<a ping>"). The value of this preference is of type boolean, and the default value is true.</dd> <dd style="display: none; "> This parameter was added in version <b><span></span></b>. diff --git a/chrome/common/extensions/docs/experimental.html b/chrome/common/extensions/docs/experimental.html index cb23ce1..1ca13e3 100644 --- a/chrome/common/extensions/docs/experimental.html +++ b/chrome/common/extensions/docs/experimental.html @@ -321,7 +321,7 @@ on the following experimental APIs: <ul> <li> - <a href="experimental.contentSettings.misc.html">experimental.contentSettings.misc</a></li><li> + <a href="experimental.contentSettings.global.html">experimental.contentSettings.global</a></li><li> <a href="experimental.debugger.html">experimental.debugger</a></li><li> <a href="experimental.devtools.audits.html">experimental.devtools.audits</a></li><li> <a href="experimental.devtools.panels.html">experimental.devtools.panels</a></li><li> diff --git a/chrome/common/extensions/docs/samples.json b/chrome/common/extensions/docs/samples.json index 6ecdd02..9a931a6 100644 --- a/chrome/common/extensions/docs/samples.json +++ b/chrome/common/extensions/docs/samples.json @@ -675,7 +675,7 @@ "manifest.json", "popup.html" ], - "source_hash": "97a0009e38509549b1dd3eca84ee7aacd3aae4d7", + "source_hash": "2919c196fec8721c240b529b7763c36f7330d986", "zip_path": "examples\/api\/preferences\/enableReferrer.zip" }, { diff --git a/chrome/renderer/resources/renderer_extension_bindings.js b/chrome/renderer/resources/renderer_extension_bindings.js index aeede6d..0c3ce07 100644 --- a/chrome/renderer/resources/renderer_extension_bindings.js +++ b/chrome/renderer/resources/renderer_extension_bindings.js @@ -301,7 +301,7 @@ var chrome = chrome || {}; "devtools", "experimental.accessibility", "experimental.bookmarkManager", - "experimental.contentSettings.misc", + "experimental.contentSettings.global", "experimental.debugger", "experimental.extension", "experimental.infobars", diff --git a/chrome/test/data/extensions/api_test/content_settings/clear/test.html b/chrome/test/data/extensions/api_test/content_settings/clear/test.html index 6927f6a..69ffc7b 100644 --- a/chrome/test/data/extensions/api_test/content_settings/clear/test.html +++ b/chrome/test/data/extensions/api_test/content_settings/clear/test.html @@ -4,33 +4,33 @@ var cs = chrome.experimental.contentSettings; chrome.test.runTests([ - function getBlockThirdPartyCookies() { - cs.misc.blockThirdPartyCookies.get({}, chrome.test.callbackPass( - function(block) { + function getThirdPartyCookiesAllowed() { + cs.global.thirdPartyCookiesAllowed.get({}, chrome.test.callbackPass( + function(allowed) { chrome.test.assertEq( - block, + allowed, { - 'value': true, + 'value': false, 'levelOfControl': "controllable_by_this_extension" }, "third-party cookies should be blocked"); })); }, - function setBlockThirdPartyCookies() { - cs.misc.blockThirdPartyCookies.set( - {'value': false}, + function setThirdPartyCookiesAllowed() { + cs.global.thirdPartyCookiesAllowed.set( + {'value': true}, chrome.test.callbackPass()); }, - function clearBlockThirdPartyCookies() { - cs.misc.blockThirdPartyCookies.clear({}, chrome.test.callbackPass()); + function clearThirdPartyCookiesAllowed() { + cs.global.thirdPartyCookiesAllowed.clear({}, chrome.test.callbackPass()); }, - function getBlockThirdPartyCookies2() { - cs.misc.blockThirdPartyCookies.get({}, chrome.test.callbackPass( - function(block) { + function getThirdPartyCookiesAllowed2() { + cs.global.thirdPartyCookiesAllowed.get({}, chrome.test.callbackPass( + function(allowed) { chrome.test.assertEq( - block, + allowed, { - 'value': true, + 'value': false, 'levelOfControl': "controllable_by_this_extension" }, "third-party cookies should be blocked"); diff --git a/chrome/test/data/extensions/api_test/content_settings/onchange/test.html b/chrome/test/data/extensions/api_test/content_settings/onchange/test.html index c510f6e..20be7d6 100644 --- a/chrome/test/data/extensions/api_test/content_settings/onchange/test.html +++ b/chrome/test/data/extensions/api_test/content_settings/onchange/test.html @@ -22,73 +22,73 @@ chrome.test.runTests([ function changeDefault() { // Changing the regular settings when no incognito-specific settings are // defined should fire two events. - listenUntil(cs.misc.blockThirdPartyCookies.onChange, [{ - 'value': true, + listenUntil(cs.global.thirdPartyCookiesAllowed.onChange, [{ + 'value': false, 'levelOfControl': 'controlled_by_this_extension' }, { - 'value': true, + 'value': false, 'incognitoSpecific': false, 'levelOfControl': 'controlled_by_this_extension' }]); - cs.misc.blockThirdPartyCookies.set({ - 'value':true + cs.global.thirdPartyCookiesAllowed.set({ + 'value':false }, chrome.test.callbackPass()); }, function changeIncognitoOnly() { - listenUntil(cs.misc.blockThirdPartyCookies.onChange, [{ - 'value': false, + listenUntil(cs.global.thirdPartyCookiesAllowed.onChange, [{ + 'value': true, 'incognitoSpecific': true, 'levelOfControl': 'controlled_by_this_extension' }]); - cs.misc.blockThirdPartyCookies.set({ - 'value': false, + cs.global.thirdPartyCookiesAllowed.set({ + 'value': true, 'scope': 'incognito_persistent' }, chrome.test.callbackPass()); }, function changeDefaultOnly() { - listenUntil(cs.misc.blockThirdPartyCookies.onChange, [{ - 'value': false, + listenUntil(cs.global.thirdPartyCookiesAllowed.onChange, [{ + 'value': true, 'levelOfControl': 'controlled_by_this_extension' }]); - cs.misc.blockThirdPartyCookies.set({ - 'value': false + cs.global.thirdPartyCookiesAllowed.set({ + 'value': true }, chrome.test.callbackPass()); }, function changeIncognitoOnlyBack() { - // Change the incognito setting back to true so that we get an event when + // Change the incognito setting back to false so that we get an event when // clearing the value. - listenUntil(cs.misc.blockThirdPartyCookies.onChange, [{ - 'value': true, + listenUntil(cs.global.thirdPartyCookiesAllowed.onChange, [{ + 'value': false, 'incognitoSpecific': true, 'levelOfControl': 'controlled_by_this_extension' }]); - cs.misc.blockThirdPartyCookies.set({ - 'value': true, + cs.global.thirdPartyCookiesAllowed.set({ + 'value': false, 'scope': 'incognito_persistent' }, chrome.test.callbackPass()); }, function clearIncognito() { - listenUntil(cs.misc.blockThirdPartyCookies.onChange, [{ - 'value': false, + listenUntil(cs.global.thirdPartyCookiesAllowed.onChange, [{ + 'value': true, 'incognitoSpecific': false, 'levelOfControl': 'controlled_by_this_extension' }]); - cs.misc.blockThirdPartyCookies.clear({ + cs.global.thirdPartyCookiesAllowed.clear({ 'scope': 'incognito_persistent' }, chrome.test.callbackPass()); }, function clearDefault() { - listenUntil(cs.misc.blockThirdPartyCookies.onChange, [{ - 'value': false, + listenUntil(cs.global.thirdPartyCookiesAllowed.onChange, [{ + 'value': true, 'levelOfControl': 'controllable_by_this_extension' }, { - 'value': false, + 'value': true, 'incognitoSpecific': false, 'levelOfControl': 'controllable_by_this_extension' }]); - cs.misc.blockThirdPartyCookies.clear({}, chrome.test.callbackPass()); + cs.global.thirdPartyCookiesAllowed.clear({}, chrome.test.callbackPass()); } ]); diff --git a/chrome/test/data/extensions/api_test/content_settings/persistent_incognito/test.html b/chrome/test/data/extensions/api_test/content_settings/persistent_incognito/test.html index 6d202da..486bd23 100644 --- a/chrome/test/data/extensions/api_test/content_settings/persistent_incognito/test.html +++ b/chrome/test/data/extensions/api_test/content_settings/persistent_incognito/test.html @@ -11,36 +11,36 @@ function expect(expected, message) { } chrome.test.runTests([ function getRegular() { - cs.misc.blockThirdPartyCookies.get( + cs.global.thirdPartyCookiesAllowed.get( {}, - expect({ 'value': false, + expect({ 'value': true, 'levelOfControl': "controllable_by_this_extension" }, "third-party cookies should not be blocked")); }, function getIncognito() { - cs.misc.blockThirdPartyCookies.get( + cs.global.thirdPartyCookiesAllowed.get( { 'incognito': true }, - expect({ 'value': false, + expect({ 'value': true, 'incognitoSpecific': false, 'levelOfControl': "controllable_by_this_extension" }, "third-party cookies should not be blocked in incognito mode")); }, function set() { - cs.misc.blockThirdPartyCookies.set( - { 'scope': 'incognito_persistent', 'value': true }, + cs.global.thirdPartyCookiesAllowed.set( + { 'scope': 'incognito_persistent', 'value': false }, chrome.test.callbackPass()); }, function getRegular2() { - cs.misc.blockThirdPartyCookies.get( + cs.global.thirdPartyCookiesAllowed.get( {}, - expect({ 'value': false, + expect({ 'value': true, 'levelOfControl': "controllable_by_this_extension" }, "third-party cookies should not be blocked")); }, function getIncognito2() { - cs.misc.blockThirdPartyCookies.get( + cs.global.thirdPartyCookiesAllowed.get( { 'incognito': true }, - expect({ 'value': true, + expect({ 'value': false, 'incognitoSpecific': true, 'levelOfControl': "controlled_by_this_extension" }, "third-party cookies should be blocked in incognito mode")); diff --git a/chrome/test/data/extensions/api_test/content_settings/session_only_incognito/test.html b/chrome/test/data/extensions/api_test/content_settings/session_only_incognito/test.html index ee77a28..accf7d8 100644 --- a/chrome/test/data/extensions/api_test/content_settings/session_only_incognito/test.html +++ b/chrome/test/data/extensions/api_test/content_settings/session_only_incognito/test.html @@ -11,36 +11,36 @@ function expect(expected, message) { } chrome.test.runTests([ function getRegular() { - cs.misc.blockThirdPartyCookies.get( + cs.global.thirdPartyCookiesAllowed.get( {}, - expect({ 'value': false, + expect({ 'value': true, 'levelOfControl': "controllable_by_this_extension" }, "third-party cookies should not be blocked")); }, function getIncognito() { - cs.misc.blockThirdPartyCookies.get( + cs.global.thirdPartyCookiesAllowed.get( { 'incognito': true }, - expect({ 'value': false, + expect({ 'value': true, 'incognitoSpecific': false, 'levelOfControl': "controllable_by_this_extension" }, "third-party cookies should not be blocked in incognito mode")); }, function set() { - cs.misc.blockThirdPartyCookies.set( - { 'scope': 'incognito_persistent', 'value': true }, + cs.global.thirdPartyCookiesAllowed.set( + { 'scope': 'incognito_persistent', 'value': false }, chrome.test.callbackPass()); }, function getRegular2() { - cs.misc.blockThirdPartyCookies.get( + cs.global.thirdPartyCookiesAllowed.get( {}, - expect({ 'value': false, + expect({ 'value': true, 'levelOfControl': "controllable_by_this_extension" }, "third-party cookies should not be blocked")); }, function getIncognito2() { - cs.misc.blockThirdPartyCookies.get( + cs.global.thirdPartyCookiesAllowed.get( { 'incognito': true }, - expect({ 'value': true, + expect({ 'value': false, 'incognitoSpecific': true, 'levelOfControl': "controlled_by_this_extension" }, "third-party cookies should be blocked in incognito mode")); @@ -48,8 +48,8 @@ chrome.test.runTests([ // We cannot set session_only_persistent preferences if there is no incognito // session. function set2() { - cs.misc.blockThirdPartyCookies.set( - { 'scope': 'incognito_session_only', 'value': false }, + cs.global.thirdPartyCookiesAllowed.set( + { 'scope': 'incognito_session_only', 'value': true }, chrome.test.callbackFail("You cannot set a preference with scope " + "'incognito_session_only' when no incognito " + "window is open.")); @@ -59,21 +59,21 @@ chrome.test.runTests([ }, // session_only_persistent overrides incognito_persistent. function set3() { - cs.misc.blockThirdPartyCookies.set( - { 'scope': 'incognito_session_only', 'value': false }, + cs.global.thirdPartyCookiesAllowed.set( + { 'scope': 'incognito_session_only', 'value': true }, chrome.test.callbackPass()); }, function getRegular3() { - cs.misc.blockThirdPartyCookies.get( + cs.global.thirdPartyCookiesAllowed.get( {}, - expect({ 'value': false, + expect({ 'value': true, 'levelOfControl': "controllable_by_this_extension" }, "third-party cookies should not be blocked")); }, function getIncognito3() { - cs.misc.blockThirdPartyCookies.get( + cs.global.thirdPartyCookiesAllowed.get( { 'incognito': true }, - expect({ 'value': false, + expect({ 'value': true, 'incognitoSpecific': true, 'levelOfControl': "controlled_by_this_extension" }, "third-party cookies should be blocked in incognito mode")); 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 8dc75fb..d36a03a 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 @@ -9,27 +9,27 @@ function expect(expected, message) { }); } chrome.test.runTests([ - function getBlockThirdPartyCookies() { - cs.misc.blockThirdPartyCookies.get( + function getThirdPartyCookiesAllowed() { + cs.global.thirdPartyCookiesAllowed.get( {}, - expect({ 'value': true, + expect({ 'value': false, 'levelOfControl': "controllable_by_this_extension" }, "third-party cookies should be blocked")); }, - function getEnableReferrers() { - cs.misc.enableReferrers.get( + function getReferrersEnabled() { + cs.global.referrersEnabled.get( {}, expect({ 'value': false, 'levelOfControl': "controllable_by_this_extension" }, "referrers should be disabled")); }, - function setBlockThirdPartyCookies() { - cs.misc.blockThirdPartyCookies.set( - {'value': false}, + function setThirdPartyCookiesAllowed() { + cs.global.thirdPartyCookiesAllowed.set( + {'value': true}, chrome.test.callbackPass()); }, - function setEnableReferrers() { - cs.misc.enableReferrers.set( + function setReferrersEnabled() { + cs.global.referrersEnabled.set( {'value': true}, chrome.test.callbackPass()); } |