Commit ff566f41 authored by Robert Ogden's avatar Robert Ogden Committed by Commit Bot

Revert "HTTPS Previews: Use the DRP experiment instead of a Finch-provided one"

This reverts commit f54db458.

Reason for revert: Miscommunication with server team requirements. Need to change some logic

Original change's description:
> HTTPS Previews: Use the DRP experiment instead of a Finch-provided one
> 
> This experiment doesn't actually seem very useful in Finch. It's better
> to reuse the DRP experiment which is accessible in chrome://flags.
> 
> Bug: 934376
> Change-Id: I27a5bdfa4f57fa761eaae62106113e7fc5529ba1
> Reviewed-on: https://chromium-review.googlesource.com/c/1481995
> Reviewed-by: Ryan Sturm <ryansturm@chromium.org>
> Commit-Queue: Robert Ogden <robertogden@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#634682}

TBR=robertogden@chromium.org,ryansturm@chromium.org

Change-Id: I354e3ca9ccd61617b47031ba0880890084210a9d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 934376
Reviewed-on: https://chromium-review.googlesource.com/c/1482947Reviewed-by: default avatarRobert Ogden <robertogden@chromium.org>
Commit-Queue: Robert Ogden <robertogden@chromium.org>
Cr-Commit-Position: refs/heads/master@{#634706}
parent 45479a35
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
#include "base/bind.h" #include "base/bind.h"
#include "base/callback.h" #include "base/callback.h"
#include "base/command_line.h"
#include "base/memory/weak_ptr.h" #include "base/memory/weak_ptr.h"
#include "base/metrics/histogram_macros.h" #include "base/metrics/histogram_macros.h"
#include "base/optional.h" #include "base/optional.h"
...@@ -37,7 +36,6 @@ ...@@ -37,7 +36,6 @@
#include "components/content_settings/core/common/cookie_settings_base.h" #include "components/content_settings/core/common/cookie_settings_base.h"
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_request_options.h" #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_request_options.h"
#include "components/data_reduction_proxy/core/common/data_reduction_proxy_headers.h" #include "components/data_reduction_proxy/core/common/data_reduction_proxy_headers.h"
#include "components/data_reduction_proxy/core/common/data_reduction_proxy_switches.h"
#include "components/previews/core/previews_experiments.h" #include "components/previews/core/previews_experiments.h"
#include "components/previews/core/previews_lite_page_redirect.h" #include "components/previews/core/previews_lite_page_redirect.h"
#include "content/public/browser/browser_context.h" #include "content/public/browser/browser_context.h"
...@@ -321,8 +319,7 @@ GURL PreviewsLitePageNavigationThrottle::GetPreviewsURLForURL( ...@@ -321,8 +319,7 @@ GURL PreviewsLitePageNavigationThrottle::GetPreviewsURLForURL(
const GURL& original_url) { const GURL& original_url) {
DCHECK(original_url.is_valid()); DCHECK(original_url.is_valid());
std::string experiment_id = std::string experiment_id =
base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( previews::params::LitePageRedirectPreviewExperiment();
data_reduction_proxy::switches::kDataReductionProxyExperiment);
std::string experiment_query; std::string experiment_query;
if (!experiment_id.empty()) { if (!experiment_id.empty()) {
experiment_query = experiment_query =
......
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
#include <memory> #include <memory>
#include "base/command_line.h"
#include "base/memory/ptr_util.h" #include "base/memory/ptr_util.h"
#include "base/metrics/field_trial.h" #include "base/metrics/field_trial.h"
#include "base/metrics/field_trial_params.h" #include "base/metrics/field_trial_params.h"
...@@ -14,7 +13,6 @@ ...@@ -14,7 +13,6 @@
#include "base/test/scoped_task_environment.h" #include "base/test/scoped_task_environment.h"
#include "chrome/browser/previews/previews_lite_page_decider.h" #include "chrome/browser/previews/previews_lite_page_decider.h"
#include "chrome/test/base/chrome_render_view_host_test_harness.h" #include "chrome/test/base/chrome_render_view_host_test_harness.h"
#include "components/data_reduction_proxy/core/common/data_reduction_proxy_switches.h"
#include "components/previews/core/previews_features.h" #include "components/previews/core/previews_features.h"
#include "content/public/browser/navigation_handle.h" #include "content/public/browser/navigation_handle.h"
#include "net/http/http_util.h" #include "net/http/http_util.h"
...@@ -99,14 +97,11 @@ TEST(PreviewsLitePageNavigationThrottleTest, TestGetPreviewsURL) { ...@@ -99,14 +97,11 @@ TEST(PreviewsLitePageNavigationThrottleTest, TestGetPreviewsURL) {
}; };
for (const TestCase& test_case : kTestCases) { for (const TestCase& test_case : kTestCases) {
base::CommandLine::ForCurrentProcess()->AppendSwitchASCII(
data_reduction_proxy::switches::kDataReductionProxyExperiment,
test_case.experiment);
base::test::ScopedFeatureList scoped_feature_list; base::test::ScopedFeatureList scoped_feature_list;
scoped_feature_list.InitAndEnableFeatureWithParameters( scoped_feature_list.InitAndEnableFeatureWithParameters(
previews::features::kLitePageServerPreviews, previews::features::kLitePageServerPreviews,
{{"previews_host", test_case.previews_host}}); {{"previews_host", test_case.previews_host},
{"lite_page_preview_experiment", test_case.experiment}});
EXPECT_EQ(PreviewsLitePageNavigationThrottle::GetPreviewsURLForURL( EXPECT_EQ(PreviewsLitePageNavigationThrottle::GetPreviewsURLForURL(
GURL(test_case.original_url)), GURL(test_case.original_url)),
......
...@@ -219,6 +219,11 @@ GURL GetLitePagePreviewsDomainURL() { ...@@ -219,6 +219,11 @@ GURL GetLitePagePreviewsDomainURL() {
return GURL("https://litepages.googlezip.net/"); return GURL("https://litepages.googlezip.net/");
} }
std::string LitePageRedirectPreviewExperiment() {
return GetFieldTrialParamValueByFeature(features::kLitePageServerPreviews,
"lite_page_preview_experiment");
}
bool IsInLitePageRedirectControl() { bool IsInLitePageRedirectControl() {
return base::GetFieldTrialParamByFeatureAsBool( return base::GetFieldTrialParamByFeatureAsBool(
features::kLitePageServerPreviews, "control_group", false); features::kLitePageServerPreviews, "control_group", false);
......
...@@ -123,6 +123,9 @@ size_t LitePageRedirectPreviewMaxNavigationRestarts(); ...@@ -123,6 +123,9 @@ size_t LitePageRedirectPreviewMaxNavigationRestarts();
// The maximum number of seconds to loadshed the Previews server for. // The maximum number of seconds to loadshed the Previews server for.
int PreviewServerLoadshedMaxSeconds(); int PreviewServerLoadshedMaxSeconds();
// The experimental config to send to the previews server.
std::string LitePageRedirectPreviewExperiment();
// Returns true if we should only report metrics and not trigger when the Lite // Returns true if we should only report metrics and not trigger when the Lite
// Page Redirect preview is enabled. // Page Redirect preview is enabled.
bool IsInLitePageRedirectControl(); bool IsInLitePageRedirectControl();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment