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

Unified Diff: chrome/browser/ui/content_settings/content_setting_bubble_model_unittest.cc

Issue 106713004: Remove kEnableResourceContentSettings and all the code that uses it since it's been behind a flag f… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: review comments Created 7 years 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/browser/ui/content_settings/content_setting_bubble_model_unittest.cc
===================================================================
--- chrome/browser/ui/content_settings/content_setting_bubble_model_unittest.cc (revision 239860)
+++ chrome/browser/ui/content_settings/content_setting_bubble_model_unittest.cc (working copy)
@@ -56,8 +56,7 @@
TEST_F(ContentSettingBubbleModelTest, ImageRadios) {
TabSpecificContentSettings* content_settings =
TabSpecificContentSettings::FromWebContents(web_contents());
- content_settings->OnContentBlocked(CONTENT_SETTINGS_TYPE_IMAGES,
- std::string());
+ content_settings->OnContentBlocked(CONTENT_SETTINGS_TYPE_IMAGES);
scoped_ptr<ContentSettingBubbleModel> content_setting_bubble_model(
ContentSettingBubbleModel::CreateContentSettingBubbleModel(
@@ -75,8 +74,7 @@
TEST_F(ContentSettingBubbleModelTest, Cookies) {
TabSpecificContentSettings* content_settings =
TabSpecificContentSettings::FromWebContents(web_contents());
- content_settings->OnContentBlocked(CONTENT_SETTINGS_TYPE_COOKIES,
- std::string());
+ content_settings->OnContentBlocked(CONTENT_SETTINGS_TYPE_COOKIES);
scoped_ptr<ContentSettingBubbleModel> content_setting_bubble_model(
ContentSettingBubbleModel::CreateContentSettingBubbleModel(
@@ -449,8 +447,7 @@
TEST_F(ContentSettingBubbleModelTest, Plugins) {
TabSpecificContentSettings* content_settings =
TabSpecificContentSettings::FromWebContents(web_contents());
- content_settings->OnContentBlocked(CONTENT_SETTINGS_TYPE_PLUGINS,
- std::string());
+ content_settings->OnContentBlocked(CONTENT_SETTINGS_TYPE_PLUGINS);
scoped_ptr<ContentSettingBubbleModel> content_setting_bubble_model(
ContentSettingBubbleModel::CreateContentSettingBubbleModel(
@@ -465,79 +462,10 @@
EXPECT_FALSE(bubble_content.manage_link.empty());
}
-TEST_F(ContentSettingBubbleModelTest, MultiplePlugins) {
- CommandLine* cmd = CommandLine::ForCurrentProcess();
- base::AutoReset<CommandLine> auto_reset(cmd, *cmd);
- cmd->AppendSwitch(switches::kEnableResourceContentSettings);
-
- HostContentSettingsMap* map = profile()->GetHostContentSettingsMap();
- std::string fooPlugin = "foo";
- std::string barPlugin = "bar";
-
- // Navigating to some sample url prevents the GetURL method from returning an
- // invalid empty URL.
- WebContentsTester::For(web_contents())->
- NavigateAndCommit(GURL("http://www.example.com"));
- GURL url = web_contents()->GetURL();
- map->AddExceptionForURL(url,
- url,
- CONTENT_SETTINGS_TYPE_PLUGINS,
- fooPlugin,
- CONTENT_SETTING_ALLOW);
- map->AddExceptionForURL(url,
- url,
- CONTENT_SETTINGS_TYPE_PLUGINS,
- barPlugin,
- CONTENT_SETTING_ASK);
-
- TabSpecificContentSettings* content_settings =
- TabSpecificContentSettings::FromWebContents(web_contents());
- content_settings->OnContentBlocked(CONTENT_SETTINGS_TYPE_PLUGINS,
- fooPlugin);
- content_settings->OnContentBlocked(CONTENT_SETTINGS_TYPE_PLUGINS,
- barPlugin);
-
- scoped_ptr<ContentSettingBubbleModel> content_setting_bubble_model(
- ContentSettingBubbleModel::CreateContentSettingBubbleModel(
- NULL, web_contents(), profile(),
- CONTENT_SETTINGS_TYPE_PLUGINS));
- const ContentSettingBubbleModel::BubbleContent& bubble_content =
- content_setting_bubble_model->bubble_content();
- EXPECT_EQ(2U, bubble_content.radio_group.radio_items.size());
- EXPECT_EQ(1, bubble_content.radio_group.default_item);
-
- content_setting_bubble_model->OnRadioClicked(0);
- // Nothing should have changed.
- EXPECT_EQ(CONTENT_SETTING_ALLOW,
- map->GetContentSetting(url,
- url,
- CONTENT_SETTINGS_TYPE_PLUGINS,
- fooPlugin));
- EXPECT_EQ(CONTENT_SETTING_ASK,
- map->GetContentSetting(url,
- url,
- CONTENT_SETTINGS_TYPE_PLUGINS,
- barPlugin));
-
- content_setting_bubble_model.reset();
- // Both plug-ins should be click-to-play now.
- EXPECT_EQ(CONTENT_SETTING_ALLOW,
- map->GetContentSetting(url,
- url,
- CONTENT_SETTINGS_TYPE_PLUGINS,
- fooPlugin));
- EXPECT_EQ(CONTENT_SETTING_ALLOW,
- map->GetContentSetting(url,
- url,
- CONTENT_SETTINGS_TYPE_PLUGINS,
- barPlugin));
-}
-
TEST_F(ContentSettingBubbleModelTest, PepperBroker) {
TabSpecificContentSettings* content_settings =
TabSpecificContentSettings::FromWebContents(web_contents());
- content_settings->OnContentBlocked(CONTENT_SETTINGS_TYPE_PPAPI_BROKER,
- std::string());
+ content_settings->OnContentBlocked(CONTENT_SETTINGS_TYPE_PPAPI_BROKER);
scoped_ptr<ContentSettingBubbleModel> content_setting_bubble_model(
ContentSettingBubbleModel::CreateContentSettingBubbleModel(
@@ -615,7 +543,7 @@
std::string file_url("file:///tmp/test.html");
NavigateAndCommit(GURL(file_url));
TabSpecificContentSettings::FromWebContents(web_contents())->OnContentBlocked(
- CONTENT_SETTINGS_TYPE_IMAGES, std::string());
+ CONTENT_SETTINGS_TYPE_IMAGES);
scoped_ptr<ContentSettingBubbleModel> content_setting_bubble_model(
ContentSettingBubbleModel::CreateContentSettingBubbleModel(
NULL, web_contents(), profile(),

Powered by Google App Engine
This is Rietveld 408576698