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

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: Address comments. Created 4 years, 3 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)));
+}

Powered by Google App Engine
This is Rietveld 408576698