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

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

Issue 11488009: Add content settings page action for Pepper broker authorization. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 7 years, 10 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 d3bbc6745167cc8f9f261032a953cbd85b3554e5..e4374855b895878eeea83c6d2a03ebd4faf5dc8d 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
@@ -289,6 +289,45 @@ TEST_F(ContentSettingBubbleModelTest, MultiplePlugins) {
barPlugin));
}
+TEST_F(ContentSettingBubbleModelTest, PepperBroker) {
+ TabSpecificContentSettings* content_settings =
+ TabSpecificContentSettings::FromWebContents(web_contents());
+ content_settings->OnContentBlocked(CONTENT_SETTINGS_TYPE_PPAPI_BROKER,
+ std::string());
+
+ scoped_ptr<ContentSettingBubbleModel> content_setting_bubble_model(
+ ContentSettingBubbleModel::CreateContentSettingBubbleModel(
+ NULL, web_contents(), profile(),
+ CONTENT_SETTINGS_TYPE_PPAPI_BROKER));
+ const ContentSettingBubbleModel::BubbleContent& bubble_content =
+ content_setting_bubble_model->bubble_content();
+
+ std::string title = bubble_content.title;
+ EXPECT_FALSE(title.empty());
+ ASSERT_EQ(2U, bubble_content.radio_group.radio_items.size());
+ std::string radio1 = bubble_content.radio_group.radio_items[0];
+ std::string radio2 = bubble_content.radio_group.radio_items[1];
+ EXPECT_FALSE(bubble_content.custom_link_enabled);
+ EXPECT_FALSE(bubble_content.manage_link.empty());
+
+ content_settings->ClearBlockedContentSettingsExceptForCookies();
+ content_settings->OnContentAccessed(CONTENT_SETTINGS_TYPE_PPAPI_BROKER);
+ content_setting_bubble_model.reset(
+ ContentSettingBubbleModel::CreateContentSettingBubbleModel(
+ NULL, web_contents(), profile(),
+ CONTENT_SETTINGS_TYPE_PPAPI_BROKER));
+ const ContentSettingBubbleModel::BubbleContent& bubble_content_2 =
+ content_setting_bubble_model->bubble_content();
+
+ EXPECT_FALSE(bubble_content_2.title.empty());
+ EXPECT_NE(title, bubble_content_2.title);
+ ASSERT_EQ(2U, bubble_content_2.radio_group.radio_items.size());
+ EXPECT_NE(radio1, bubble_content_2.radio_group.radio_items[0]);
+ EXPECT_NE(radio2, bubble_content_2.radio_group.radio_items[1]);
+ EXPECT_FALSE(bubble_content_2.custom_link_enabled);
+ EXPECT_FALSE(bubble_content_2.manage_link.empty());
+}
+
TEST_F(ContentSettingBubbleModelTest, Geolocation) {
const GURL page_url("http://toplevel.example/");
const GURL frame1_url("http://host1.example/");
@@ -331,6 +370,8 @@ TEST_F(ContentSettingBubbleModelTest, Geolocation) {
TEST_F(ContentSettingBubbleModelTest, FileURL) {
std::string file_url("file:///tmp/test.html");
NavigateAndCommit(GURL(file_url));
+ TabSpecificContentSettings::FromWebContents(web_contents())->OnContentBlocked(
+ CONTENT_SETTINGS_TYPE_IMAGES, std::string());
scoped_ptr<ContentSettingBubbleModel> content_setting_bubble_model(
ContentSettingBubbleModel::CreateContentSettingBubbleModel(
NULL, web_contents(), profile(),

Powered by Google App Engine
This is Rietveld 408576698