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

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

Issue 1084123002: Make DETECT_IMPORTANT_CONTENT the default Plugins content setting based (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: gn fixes Created 5 years, 8 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/plugins_field_trial_browsertest.cc
diff --git a/chrome/browser/plugins/plugins_field_trial_browsertest.cc b/chrome/browser/plugins/plugins_field_trial_browsertest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..0f13ce0878040ec6feff107844464c83a215d1a7
--- /dev/null
+++ b/chrome/browser/plugins/plugins_field_trial_browsertest.cc
@@ -0,0 +1,41 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "components/content_settings/core/browser/plugins_field_trial.h"
+
+#include "base/command_line.h"
+#include "base/macros.h"
+#include "base/prefs/pref_service.h"
+#include "chrome/browser/profiles/profile.h"
Dan Beam 2015/04/16 18:58:15 afaik, this file needs to live here because its de
+#include "chrome/browser/ui/browser.h"
+#include "chrome/test/base/in_process_browser_test.h"
+#include "components/content_settings/core/common/content_settings.h"
+#include "components/content_settings/core/common/pref_names.h"
+#include "content/public/common/content_switches.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+using content_settings::PluginsFieldTrial;
+
+class PluginsFieldTrialPrefTest : public InProcessBrowserTest {
+ public:
+ PluginsFieldTrialPrefTest() {}
+ ~PluginsFieldTrialPrefTest() override {}
+
+ void SetUpCommandLine(base::CommandLine* cli) override {
+ InProcessBrowserTest::SetUpCommandLine(cli);
+ std::string forced_field_trials(PluginsFieldTrial::kFieldTrialName);
+ forced_field_trials += "/Enabled/";
+ cli->AppendSwitchASCII(switches::kForceFieldTrials, forced_field_trials);
+ }
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(PluginsFieldTrialPrefTest);
+};
+
+IN_PROC_BROWSER_TEST_F(PluginsFieldTrialPrefTest, EnableFieldTrialNoPrefSet) {
tommycli 2015/04/17 17:03:56 It seems tragic to have a test separated from its
Dan Beam 2015/04/18 19:37:35 Done.
+ const PrefService* prefs = browser()->profile()->GetPrefs();
+ EXPECT_EQ(CONTENT_SETTING_DETECT_IMPORTANT_CONTENT,
+ prefs->GetInteger(prefs::kDefaultPluginsSetting));
+ EXPECT_FALSE(prefs->HasPrefPath(prefs::kDefaultPluginsSetting));
+}

Powered by Google App Engine
This is Rietveld 408576698