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

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

Issue 319553008: Updated Plugin bubble model to add "learn more" link and to appear with a sliding yellow thing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed typos Created 6 years, 6 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/browser/ui/content_settings/content_setting_bubble_model_unittest.cc
diff --git a/chrome/browser/ui/content_settings/content_setting_bubble_model_unittest.cc b/chrome/browser/ui/content_settings/content_setting_bubble_model_unittest.cc
index 22fb503479298b74d00af4fc64395aa23057621a..8d6f731b9c3893dd7953a714d079526afbba7d31 100644
--- a/chrome/browser/ui/content_settings/content_setting_bubble_model_unittest.cc
+++ b/chrome/browser/ui/content_settings/content_setting_bubble_model_unittest.cc
@@ -456,10 +456,56 @@ TEST_F(ContentSettingBubbleModelTest, Plugins) {
const ContentSettingBubbleModel::BubbleContent& bubble_content =
content_setting_bubble_model->bubble_content();
EXPECT_FALSE(bubble_content.title.empty());
- EXPECT_EQ(2U, bubble_content.radio_group.radio_items.size());
- EXPECT_FALSE(bubble_content.custom_link.empty());
- EXPECT_TRUE(bubble_content.custom_link_enabled);
+ EXPECT_FALSE(bubble_content.learn_more_link.empty());
+ EXPECT_EQ(3U, bubble_content.radio_group.radio_items.size());
+ EXPECT_TRUE(bubble_content.custom_link.empty());
+ // TODO(cthomp): We no longer use custom link for plugins, so remove test?
felt 2014/06/11 02:37:30 Another TODO here, can you delete the commented ou
radhikabhar 2014/06/11 17:31:46 Done.
+ // EXPECT_TRUE(bubble_content.custom_link_enabled);
EXPECT_FALSE(bubble_content.manage_link.empty());
+
+ //Test to see that the default radio item is set to Block
felt 2014/06/11 02:37:30 Missing a space: // Test to ...
radhikabhar 2014/06/11 17:31:46 Done.
+ EXPECT_EQ(2, bubble_content.radio_group.default_item);
+}
+
+TEST_F(ContentSettingBubbleModelTest, BlockedPluginsPermissionChange) {
+ TabSpecificContentSettings* content_settings =
+ TabSpecificContentSettings::FromWebContents(web_contents());
felt 2014/06/11 02:37:30 indent line 472 by 4 more spaces
radhikabhar 2014/06/11 17:31:46 Done.
+ std::string file_url("file:///plugin/quicktime.html");
+ NavigateAndCommit(GURL(file_url));
+ content_settings->OnContentBlocked(CONTENT_SETTINGS_TYPE_PLUGINS);
+ {
+ scoped_ptr<ContentSettingBubbleModel> content_setting_bubble_model(
+ ContentSettingBubbleModel::CreateContentSettingBubbleModel(
+ NULL, web_contents(), profile(),
+ CONTENT_SETTINGS_TYPE_PLUGINS));
+ }
+
+ EXPECT_EQ(CONTENT_SETTING_BLOCK,
+ content_settings->plugin_bubble_setting());
+
+ {
+ scoped_ptr<ContentSettingBubbleModel> content_setting_bubble_model(
+ ContentSettingBubbleModel::CreateContentSettingBubbleModel(
+ NULL, web_contents(), profile(),
+ CONTENT_SETTINGS_TYPE_PLUGINS));
+ // Change the radio setting
+ content_setting_bubble_model->OnRadioClicked(0);
+ }
+
+ EXPECT_EQ(CONTENT_SETTING_ALLOW,
+ content_settings->plugin_bubble_setting());
+
+ {
+ scoped_ptr<ContentSettingBubbleModel> content_setting_bubble_model(
+ ContentSettingBubbleModel::CreateContentSettingBubbleModel(
+ NULL, web_contents(), profile(),
+ CONTENT_SETTINGS_TYPE_PLUGINS));
+ // Change the radio setting
+ content_setting_bubble_model->OnRadioClicked(1);
+ }
+
+ EXPECT_EQ(CONTENT_SETTING_DEFAULT,
+ content_settings->plugin_bubble_setting());
}
TEST_F(ContentSettingBubbleModelTest, PepperBroker) {

Powered by Google App Engine
This is Rietveld 408576698