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

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: Rebase and move the friend decl in the ifdef. 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..ce58d71b1503e6f360823afc36cf363de5b9d431 100644
--- a/chrome/browser/plugins/plugin_prefs_unittest.cc
+++ b/chrome/browser/plugins/plugin_prefs_unittest.cc
@@ -69,6 +69,10 @@ class PluginPrefsTest : public ::testing::Test {
disabled, disabled_exceptions, enabled);
}
+ void SetAlwaysOpenPdfExternally(bool value) {
+ plugin_prefs_->SetAlwaysOpenPdfExternally(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