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

Unified Diff: chrome/browser/content_settings/host_content_settings_map_unittest.cc

Issue 2512563003: Convert enable_plugins to a buildflag header. (Closed)
Patch Set: Merge Created 4 years, 1 month 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/content_settings/host_content_settings_map_unittest.cc
diff --git a/chrome/browser/content_settings/host_content_settings_map_unittest.cc b/chrome/browser/content_settings/host_content_settings_map_unittest.cc
index a7465b386b285fb972dca697d50332b8cb33ab66..f04dc4f1b87994bf52956717814c858961c161f8 100644
--- a/chrome/browser/content_settings/host_content_settings_map_unittest.cc
+++ b/chrome/browser/content_settings/host_content_settings_map_unittest.cc
@@ -28,6 +28,7 @@
#include "components/sync_preferences/testing_pref_service_syncable.h"
#include "content/public/test/test_browser_thread.h"
#include "net/base/static_cookie_policy.h"
+#include "ppapi/features/features.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
@@ -140,7 +141,7 @@ TEST_F(HostContentSettingsMapTest, DefaultValues) {
GURL(chrome::kChromeUINewTabURL), GURL(chrome::kChromeUINewTabURL),
CONTENT_SETTINGS_TYPE_JAVASCRIPT, std::string()));
-#if defined(ENABLE_PLUGINS)
+#if BUILDFLAG(ENABLE_PLUGINS)
host_content_settings_map->SetDefaultContentSetting(
CONTENT_SETTINGS_TYPE_PLUGINS, CONTENT_SETTING_ALLOW);
EXPECT_EQ(CONTENT_SETTING_ALLOW,
@@ -190,7 +191,7 @@ TEST_F(HostContentSettingsMapTest, IndividualSettings) {
EXPECT_EQ(CONTENT_SETTING_BLOCK,
host_content_settings_map->GetContentSetting(
host, host, CONTENT_SETTINGS_TYPE_COOKIES, std::string()));
-#if defined(ENABLE_PLUGINS)
+#if BUILDFLAG(ENABLE_PLUGINS)
EXPECT_EQ(CONTENT_SETTING_DETECT_IMPORTANT_CONTENT,
host_content_settings_map->GetContentSetting(
host, host, CONTENT_SETTINGS_TYPE_PLUGINS, std::string()));
@@ -203,7 +204,7 @@ TEST_F(HostContentSettingsMapTest, IndividualSettings) {
EXPECT_EQ(CONTENT_SETTING_BLOCK,
host_content_settings_map->GetContentSetting(
host, host, CONTENT_SETTINGS_TYPE_JAVASCRIPT, std::string()));
-#if defined(ENABLE_PLUGINS)
+#if BUILDFLAG(ENABLE_PLUGINS)
host_content_settings_map->SetContentSettingDefaultScope(
host, GURL(), CONTENT_SETTINGS_TYPE_PLUGINS, std::string(),
CONTENT_SETTING_ALLOW);
@@ -241,7 +242,7 @@ TEST_F(HostContentSettingsMapTest, IndividualSettings) {
host_content_settings_map->SetContentSettingDefaultScope(
host2, GURL(), CONTENT_SETTINGS_TYPE_JAVASCRIPT, std::string(),
CONTENT_SETTING_BLOCK);
-#if defined(ENABLE_PLUGINS)
+#if BUILDFLAG(ENABLE_PLUGINS)
host_content_settings_map->SetContentSettingDefaultScope(
host2, GURL(), CONTENT_SETTINGS_TYPE_PLUGINS, std::string(),
CONTENT_SETTING_BLOCK);
@@ -251,7 +252,7 @@ TEST_F(HostContentSettingsMapTest, IndividualSettings) {
CONTENT_SETTINGS_TYPE_JAVASCRIPT, std::string(), &host_settings);
// |host_settings| contains the default setting and 2 exception.
EXPECT_EQ(3U, host_settings.size());
-#if defined(ENABLE_PLUGINS)
+#if BUILDFLAG(ENABLE_PLUGINS)
host_content_settings_map->GetSettingsForOneType(
CONTENT_SETTINGS_TYPE_PLUGINS, std::string(), &host_settings);
// |host_settings| contains the default setting and 2 exceptions.
@@ -277,7 +278,7 @@ TEST_F(HostContentSettingsMapTest, Clear) {
host_content_settings_map->SetContentSettingDefaultScope(
host, GURL(), CONTENT_SETTINGS_TYPE_COOKIES, std::string(),
CONTENT_SETTING_BLOCK);
-#if defined(ENABLE_PLUGINS)
+#if BUILDFLAG(ENABLE_PLUGINS)
host_content_settings_map->SetContentSettingDefaultScope(
host, GURL(), CONTENT_SETTINGS_TYPE_PLUGINS, std::string(),
CONTENT_SETTING_BLOCK);
@@ -292,7 +293,7 @@ TEST_F(HostContentSettingsMapTest, Clear) {
CONTENT_SETTINGS_TYPE_COOKIES, std::string(), &host_settings);
// |host_settings| contains only the default setting.
EXPECT_EQ(1U, host_settings.size());
-#if defined(ENABLE_PLUGINS)
+#if BUILDFLAG(ENABLE_PLUGINS)
host_content_settings_map->GetSettingsForOneType(
CONTENT_SETTINGS_TYPE_PLUGINS, std::string(), &host_settings);
// |host_settings| contains the default setting and an exception.
@@ -523,7 +524,7 @@ TEST_F(HostContentSettingsMapTest, HostTrimEndingDotCheck) {
CONTENT_SETTINGS_TYPE_JAVASCRIPT,
std::string()));
-#if defined(ENABLE_PLUGINS)
+#if BUILDFLAG(ENABLE_PLUGINS)
EXPECT_EQ(CONTENT_SETTING_DETECT_IMPORTANT_CONTENT,
host_content_settings_map->GetContentSetting(
host_ending_with_dot,
@@ -1024,7 +1025,7 @@ TEST_F(HostContentSettingsMapTest, ManagedDefaultContentSetting) {
host_content_settings_map->GetDefaultContentSetting(
CONTENT_SETTINGS_TYPE_JAVASCRIPT, NULL));
-#if defined(ENABLE_PLUGINS)
+#if BUILDFLAG(ENABLE_PLUGINS)
// Set preference to manage the default-content-setting for Plugins.
prefs->SetManagedPref(prefs::kManagedDefaultPluginsSetting,
new base::FundamentalValue(CONTENT_SETTING_BLOCK));

Powered by Google App Engine
This is Rietveld 408576698