OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "components/data_reduction_proxy/core/browser/data_reduction_proxy_conf
ig_service_client.h" | 5 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_conf
ig_service_client.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 | 139 |
140 void RunUntilIdle() { | 140 void RunUntilIdle() { |
141 test_context_->RunUntilIdle(); | 141 test_context_->RunUntilIdle(); |
142 } | 142 } |
143 | 143 |
144 net::MockClientSocketFactory* mock_socket_factory() { | 144 net::MockClientSocketFactory* mock_socket_factory() { |
145 return &mock_socket_factory_; | 145 return &mock_socket_factory_; |
146 } | 146 } |
147 | 147 |
148 private: | 148 private: |
| 149 base::MessageLoopForIO message_loop_; |
149 net::TestURLRequestContext context_; | 150 net::TestURLRequestContext context_; |
150 net::MockClientSocketFactory mock_socket_factory_; | 151 net::MockClientSocketFactory mock_socket_factory_; |
151 | 152 |
152 scoped_ptr<DataReductionProxyTestContext> test_context_; | 153 scoped_ptr<DataReductionProxyTestContext> test_context_; |
153 scoped_ptr<DataReductionProxyRequestOptions> request_options_; | 154 scoped_ptr<DataReductionProxyRequestOptions> request_options_; |
154 }; | 155 }; |
155 | 156 |
156 TEST_F(DataReductionProxyConfigServiceClientTest, TestConstructStaticResponse) { | 157 TEST_F(DataReductionProxyConfigServiceClientTest, TestConstructStaticResponse) { |
157 scoped_ptr<DataReductionProxyConfigServiceClient> config_client = | 158 scoped_ptr<DataReductionProxyConfigServiceClient> config_client = |
158 BuildConfigClient(); | 159 BuildConfigClient(); |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
381 }; | 382 }; |
382 net::StaticSocketDataProvider socket_data_provider( | 383 net::StaticSocketDataProvider socket_data_provider( |
383 success_reads, arraysize(success_reads), nullptr, 0); | 384 success_reads, arraysize(success_reads), nullptr, 0); |
384 mock_socket_factory()->AddSocketDataProvider(&socket_data_provider); | 385 mock_socket_factory()->AddSocketDataProvider(&socket_data_provider); |
385 config_client()->RetrieveConfig(); | 386 config_client()->RetrieveConfig(); |
386 RunUntilIdle(); | 387 RunUntilIdle(); |
387 VerifyRemoteSuccess(); | 388 VerifyRemoteSuccess(); |
388 } | 389 } |
389 | 390 |
390 } // namespace data_reduction_proxy | 391 } // namespace data_reduction_proxy |
OLD | NEW |