Chromium Code Reviews| 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..0157374808995736273d881c47fcad649bf77845 100644 |
| --- a/chrome/browser/io_thread_unittest.cc |
| +++ b/chrome/browser/io_thread_unittest.cc |
| @@ -3,7 +3,9 @@ |
| // 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" |
| @@ -14,6 +16,16 @@ 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 +126,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 +137,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 +150,20 @@ 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::GetQuicFieldTrialName(), |
| + "Enabled"); |
| + |
| + ConfigureQuicGlobals(); |
| + net::HttpNetworkSession::Params params; |
| + InitializeNetworkSessionParams(¶ms); |
| + EXPECT_FALSE(params.enable_quic); |
| + EXPECT_TRUE(params.enable_quic_for_proxies); |
|
mmenke
2015/02/12 18:10:45
I'm not following this test.
tbansal1
2015/02/13 17:10:40
When DRP field trial is enabled, we are making sur
|
| +} |
| + |
| + |
|
mmenke
2015/02/12 18:10:45
nit: Remove extra blank line
tbansal1
2015/02/13 17:10:40
Done.
|
| TEST_F(IOThreadTest, EnableQuicFromCommandLine) { |
| command_line_.AppendSwitch("enable-quic"); |
| @@ -143,6 +171,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) { |