OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <stddef.h> | 5 #include <stddef.h> |
6 | 6 |
7 #include "base/at_exit.h" | 7 #include "base/at_exit.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 class IOThreadPeer { | 49 class IOThreadPeer { |
50 public: | 50 public: |
51 static net::HttpAuthPreferences* GetAuthPreferences(IOThread* io_thread) { | 51 static net::HttpAuthPreferences* GetAuthPreferences(IOThread* io_thread) { |
52 return io_thread->globals()->http_auth_preferences.get(); | 52 return io_thread->globals()->http_auth_preferences.get(); |
53 } | 53 } |
54 static void ConfigureParamsFromFieldTrialsAndCommandLine( | 54 static void ConfigureParamsFromFieldTrialsAndCommandLine( |
55 const base::CommandLine& command_line, | 55 const base::CommandLine& command_line, |
56 bool is_quic_allowed_by_policy, | 56 bool is_quic_allowed_by_policy, |
57 net::HttpNetworkSession::Params* params) { | 57 net::HttpNetworkSession::Params* params) { |
58 IOThread::ConfigureParamsFromFieldTrialsAndCommandLine( | 58 IOThread::ConfigureParamsFromFieldTrialsAndCommandLine( |
59 command_line, is_quic_allowed_by_policy, params); | 59 command_line, is_quic_allowed_by_policy, false, params); |
60 } | 60 } |
61 }; | 61 }; |
62 | 62 |
63 class IOThreadTestWithIOThreadObject : public testing::Test { | 63 class IOThreadTestWithIOThreadObject : public testing::Test { |
64 public: | 64 public: |
65 // These functions need to be public, since it is difficult to bind to | 65 // These functions need to be public, since it is difficult to bind to |
66 // protected functions in a test (the code would need to explicitly contain | 66 // protected functions in a test (the code would need to explicitly contain |
67 // the name of the actual test class). | 67 // the name of the actual test class). |
68 void CheckCnameLookup(bool expected) { | 68 void CheckCnameLookup(bool expected) { |
69 auto* http_auth_preferences = | 69 auto* http_auth_preferences = |
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
457 command_line_.AppendSwitchASCII("testing-fixed-http-port", "42"); | 457 command_line_.AppendSwitchASCII("testing-fixed-http-port", "42"); |
458 command_line_.AppendSwitchASCII("testing-fixed-https-port", "137"); | 458 command_line_.AppendSwitchASCII("testing-fixed-https-port", "137"); |
459 | 459 |
460 ConfigureParamsFromFieldTrialsAndCommandLine(); | 460 ConfigureParamsFromFieldTrialsAndCommandLine(); |
461 | 461 |
462 EXPECT_EQ(42u, params_.testing_fixed_http_port); | 462 EXPECT_EQ(42u, params_.testing_fixed_http_port); |
463 EXPECT_EQ(137u, params_.testing_fixed_https_port); | 463 EXPECT_EQ(137u, params_.testing_fixed_https_port); |
464 } | 464 } |
465 | 465 |
466 } // namespace test | 466 } // namespace test |
OLD | NEW |