| Index: chrome/browser/io_thread_unittest.cc
|
| diff --git a/chrome/browser/io_thread_unittest.cc b/chrome/browser/io_thread_unittest.cc
|
| index 43c46692d17c526258feab86726a320ef8a9f87b..7f54240effc0bf1ec966271edda6918611963669 100644
|
| --- a/chrome/browser/io_thread_unittest.cc
|
| +++ b/chrome/browser/io_thread_unittest.cc
|
| @@ -3,17 +3,30 @@
|
| // found in the LICENSE file.
|
|
|
| #include "base/command_line.h"
|
| +#include "base/metrics/field_trial.h"
|
| #include "chrome/browser/io_thread.h"
|
| +#include "components/data_reduction_proxy/core/common/data_reduction_proxy_params.h"
|
| #include "net/http/http_network_session.h"
|
| #include "net/http/http_server_properties_impl.h"
|
| #include "net/quic/quic_protocol.h"
|
| #include "testing/gmock/include/gmock/gmock.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
|
|
| +
|
| namespace test {
|
|
|
| using ::testing::ElementsAre;
|
|
|
| +class BadEntropyProvider : public base::FieldTrial::EntropyProvider {
|
| + public:
|
| + ~BadEntropyProvider() override {}
|
| +
|
| + double GetEntropyForTrial(const std::string& trial_name,
|
| + uint32 randomization_seed) const override {
|
| + return 0.5;
|
| + }
|
| +};
|
| +
|
| class IOThreadPeer {
|
| public:
|
| static void ConfigureQuicGlobals(
|
| @@ -114,6 +127,7 @@ TEST_F(IOThreadTest, DisableQuicByDefault) {
|
| net::HttpNetworkSession::Params params;
|
| InitializeNetworkSessionParams(¶ms);
|
| EXPECT_FALSE(params.enable_quic);
|
| + EXPECT_FALSE(params.enable_quic_for_proxies);
|
| }
|
|
|
| TEST_F(IOThreadTest, EnableQuicFromFieldTrialGroup) {
|
| @@ -124,6 +138,7 @@ TEST_F(IOThreadTest, EnableQuicFromFieldTrialGroup) {
|
| net::HttpNetworkSession::Params params;
|
| InitializeNetworkSessionParams(¶ms);
|
| EXPECT_TRUE(params.enable_quic);
|
| + EXPECT_TRUE(params.enable_quic_for_proxies);
|
| EXPECT_EQ(1350u, params.quic_max_packet_length);
|
| EXPECT_EQ(1.0, params.alternate_protocol_probability_threshold);
|
| EXPECT_EQ(default_params.quic_supported_versions,
|
| @@ -136,6 +151,21 @@ TEST_F(IOThreadTest, EnableQuicFromFieldTrialGroup) {
|
| EXPECT_FALSE(params.quic_enable_truncated_connection_ids);
|
| }
|
|
|
| +TEST_F(IOThreadTest, EnableQuicFromQuicProxyFieldTrialGroup) {
|
| + base::FieldTrialList field_trial_list(new BadEntropyProvider());
|
| + base::FieldTrialList::CreateFieldTrial(
|
| + data_reduction_proxy::DataReductionProxyParams::GetFieldTrialName(),
|
| + "Enabled");
|
| +
|
| + ConfigureQuicGlobals();
|
| + net::HttpNetworkSession::Params default_params;
|
| + net::HttpNetworkSession::Params params;
|
| + InitializeNetworkSessionParams(¶ms);
|
| + EXPECT_FALSE(params.enable_quic);
|
| + EXPECT_TRUE(params.enable_quic_for_proxies);
|
| +}
|
| +
|
| +
|
| TEST_F(IOThreadTest, EnableQuicFromCommandLine) {
|
| command_line_.AppendSwitch("enable-quic");
|
|
|
| @@ -143,6 +173,7 @@ TEST_F(IOThreadTest, EnableQuicFromCommandLine) {
|
| net::HttpNetworkSession::Params params;
|
| InitializeNetworkSessionParams(¶ms);
|
| EXPECT_TRUE(params.enable_quic);
|
| + EXPECT_TRUE(params.enable_quic_for_proxies);
|
| }
|
|
|
| TEST_F(IOThreadTest, EnablePacingFromCommandLine) {
|
|
|