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

Unified Diff: chrome/browser/plugins/plugin_prefs_unittest.cc

Issue 2369353002: Adds a pref and a policy to decide if PDFs should always be opened externally. (Closed)
Patch Set: Remove changes leaked in from the dependent branch. Created 4 years, 2 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/plugins/plugin_prefs_unittest.cc
diff --git a/chrome/browser/plugins/plugin_prefs_unittest.cc b/chrome/browser/plugins/plugin_prefs_unittest.cc
index 411447e4ecbf681241d95ed3aef1694bce51a03f..51f1b16e64a2c6e62e7539024b6b79bbcae5f7c2 100644
--- a/chrome/browser/plugins/plugin_prefs_unittest.cc
+++ b/chrome/browser/plugins/plugin_prefs_unittest.cc
@@ -65,10 +65,14 @@ class PluginPrefsTest : public ::testing::Test {
const std::set<base::string16>& disabled,
const std::set<base::string16>& disabled_exceptions,
const std::set<base::string16>& enabled) {
- plugin_prefs_->SetPolicyEnforcedPluginPatterns(
+ plugin_prefs_->SetPolicyEnforcedPluginPatternsForTests(
disabled, disabled_exceptions, enabled);
}
+ void SetAlwaysOpenPdfExternally(bool value) {
+ plugin_prefs_->SetAlwaysOpenPdfExternallyForTests(value);
+ }
+
protected:
void EnablePluginSynchronously(bool enabled,
const base::FilePath& path,
@@ -285,3 +289,15 @@ TEST_F(PluginPrefsTest, UnifiedPepperFlashState) {
}
#endif
+
+TEST_F(PluginPrefsTest, AlwaysOpenPdfExternally) {
+ EXPECT_EQ(PluginPrefs::NO_POLICY,
+ plugin_prefs_->PolicyStatusForPlugin(
+ base::ASCIIToUTF16(ChromeContentClient::kPDFPluginName)));
+
+ SetAlwaysOpenPdfExternally(true);
+
+ EXPECT_EQ(PluginPrefs::POLICY_DISABLED,
+ plugin_prefs_->PolicyStatusForPlugin(
+ base::ASCIIToUTF16(ChromeContentClient::kPDFPluginName)));
+}
« no previous file with comments | « chrome/browser/plugins/plugin_prefs_factory.cc ('k') | chrome/browser/policy/configuration_policy_handler_list_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698