Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "components/content_settings/core/browser/plugins_field_trial.h" | |
| 6 | |
| 7 #include "base/command_line.h" | |
| 8 #include "base/macros.h" | |
| 9 #include "base/prefs/pref_service.h" | |
| 10 #include "chrome/browser/profiles/profile.h" | |
|
Dan Beam
2015/04/16 18:58:15
afaik, this file needs to live here because its de
| |
| 11 #include "chrome/browser/ui/browser.h" | |
| 12 #include "chrome/test/base/in_process_browser_test.h" | |
| 13 #include "components/content_settings/core/common/content_settings.h" | |
| 14 #include "components/content_settings/core/common/pref_names.h" | |
| 15 #include "content/public/common/content_switches.h" | |
| 16 #include "testing/gtest/include/gtest/gtest.h" | |
| 17 | |
| 18 using content_settings::PluginsFieldTrial; | |
| 19 | |
| 20 class PluginsFieldTrialPrefTest : public InProcessBrowserTest { | |
| 21 public: | |
| 22 PluginsFieldTrialPrefTest() {} | |
| 23 ~PluginsFieldTrialPrefTest() override {} | |
| 24 | |
| 25 void SetUpCommandLine(base::CommandLine* cli) override { | |
| 26 InProcessBrowserTest::SetUpCommandLine(cli); | |
| 27 std::string forced_field_trials(PluginsFieldTrial::kFieldTrialName); | |
| 28 forced_field_trials += "/Enabled/"; | |
| 29 cli->AppendSwitchASCII(switches::kForceFieldTrials, forced_field_trials); | |
| 30 } | |
| 31 | |
| 32 private: | |
| 33 DISALLOW_COPY_AND_ASSIGN(PluginsFieldTrialPrefTest); | |
| 34 }; | |
| 35 | |
| 36 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.
| |
| 37 const PrefService* prefs = browser()->profile()->GetPrefs(); | |
| 38 EXPECT_EQ(CONTENT_SETTING_DETECT_IMPORTANT_CONTENT, | |
| 39 prefs->GetInteger(prefs::kDefaultPluginsSetting)); | |
| 40 EXPECT_FALSE(prefs->HasPrefPath(prefs::kDefaultPluginsSetting)); | |
| 41 } | |
| OLD | NEW |