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

Unified Diff: chrome/browser/predictors/resource_prefetch_predictor_browsertest.cc

Issue 2652313002: predictors: Move the configuration of speculative prefetch to field trials. (Closed)
Patch Set: Address comments. Created 3 years, 11 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 | « chrome/browser/predictors/resource_prefetch_common_unittest.cc ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/predictors/resource_prefetch_predictor_browsertest.cc
diff --git a/chrome/browser/predictors/resource_prefetch_predictor_browsertest.cc b/chrome/browser/predictors/resource_prefetch_predictor_browsertest.cc
index cf305a34d5db42f9f6a0ccc378f0eac0ef57cfe6..4b6a681486df0d4ab3f1f84052205bd135eed63a 100644
--- a/chrome/browser/predictors/resource_prefetch_predictor_browsertest.cc
+++ b/chrome/browser/predictors/resource_prefetch_predictor_browsertest.cc
@@ -8,6 +8,7 @@
#include "base/command_line.h"
#include "base/memory/ptr_util.h"
+#include "base/strings/string_util.h"
#include "chrome/browser/browsing_data/browsing_data_helper.h"
#include "chrome/browser/browsing_data/browsing_data_remover.h"
#include "chrome/browser/browsing_data/browsing_data_remover_factory.h"
@@ -289,9 +290,13 @@ class ResourcePrefetchPredictorBrowserTest : public InProcessBrowserTest {
using URLRequestSummary = ResourcePrefetchPredictor::URLRequestSummary;
void SetUpCommandLine(base::CommandLine* command_line) override {
- command_line->AppendSwitchASCII(
- switches::kSpeculativeResourcePrefetching,
- switches::kSpeculativeResourcePrefetchingEnabledExternal);
+ command_line->AppendSwitchASCII("force-fieldtrials", "trial/group");
+ std::string parameter = base::StringPrintf(
+ "trial.group:%s/%s", kModeParamName, kExternalPrefetchingMode);
+ command_line->AppendSwitchASCII("force-fieldtrial-params", parameter);
+ std::string enabled_feature = base::StringPrintf(
+ "%s<trial", kSpeculativeResourcePrefetchingFeatureName);
+ command_line->AppendSwitchASCII("enable-features", enabled_feature);
}
void SetUpOnMainThread() override {
« no previous file with comments | « chrome/browser/predictors/resource_prefetch_common_unittest.cc ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698