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

Unified Diff: chrome/browser/policy/policy_browsertest.cc

Issue 2929713002: [Cleanup] Transition NetworkTime browser tests to use a ScopedFeatureList. (Closed)
Patch Set: Update SSLNetworkTimeBrowserTest as well Created 3 years, 6 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
« no previous file with comments | « no previous file | chrome/browser/ssl/ssl_browser_tests.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/policy/policy_browsertest.cc
diff --git a/chrome/browser/policy/policy_browsertest.cc b/chrome/browser/policy/policy_browsertest.cc
index a9df68e91cac5c06f0c136527cc9fd928f0155c7..6465b2013c009b111a06eaebe9552ed08ac38d66 100644
--- a/chrome/browser/policy/policy_browsertest.cc
+++ b/chrome/browser/policy/policy_browsertest.cc
@@ -33,6 +33,7 @@
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
+#include "base/test/scoped_feature_list.h"
#include "base/test/test_file_util.h"
#include "base/threading/sequenced_worker_pool.h"
#include "base/threading/thread_restrictions.h"
@@ -4370,10 +4371,6 @@ class NetworkTimePolicyTest : public PolicyTest {
public:
void SetUpCommandLine(base::CommandLine* command_line) override {
command_line->AppendSwitchASCII(
- switches::kEnableFeatures,
- std::string(network_time::kNetworkTimeServiceQuerying.name) +
- "<SSLNetworkTimeBrowserTestFieldTrial");
- command_line->AppendSwitchASCII(
switches::kForceFieldTrials,
"SSLNetworkTimeBrowserTestFieldTrial/Enabled/");
command_line->AppendSwitchASCII(
@@ -4382,6 +4379,14 @@ class NetworkTimePolicyTest : public PolicyTest {
"on-demand-only");
}
+ void SetUpOnMainThread() override {
+ PolicyTest::SetUpOnMainThread();
+ scoped_feature_list_.InitFromCommandLine(
+ std::string(network_time::kNetworkTimeServiceQuerying.name) +
+ "<SSLNetworkTimeBrowserTestFieldTrial",
+ std::string());
+ }
+
// A request handler that returns a dummy response and counts the number of
// times it is called.
std::unique_ptr<net::test_server::HttpResponse> CountingRequestHandler(
@@ -4402,6 +4407,7 @@ class NetworkTimePolicyTest : public PolicyTest {
private:
uint32_t num_requests_ = 0;
+ base::test::ScopedFeatureList scoped_feature_list_;
};
IN_PROC_BROWSER_TEST_F(NetworkTimePolicyTest, NetworkTimeQueriesDisabled) {
« no previous file with comments | « no previous file | chrome/browser/ssl/ssl_browser_tests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698