OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <memory> | 5 #include <memory> |
6 #include <ostream> | 6 #include <ostream> |
7 #include <utility> | 7 #include <utility> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
11 #include "base/memory/ptr_util.h" | 11 #include "base/memory/ptr_util.h" |
12 #include "base/message_loop/message_loop.h" | |
13 #include "base/run_loop.h" | 12 #include "base/run_loop.h" |
14 #include "base/strings/string_number_conversions.h" | 13 #include "base/strings/string_number_conversions.h" |
15 #include "base/test/scoped_task_scheduler.h" | |
16 #include "net/base/elements_upload_data_stream.h" | 14 #include "net/base/elements_upload_data_stream.h" |
17 #include "net/base/ip_address.h" | 15 #include "net/base/ip_address.h" |
18 #include "net/base/test_completion_callback.h" | 16 #include "net/base/test_completion_callback.h" |
19 #include "net/base/upload_bytes_element_reader.h" | 17 #include "net/base/upload_bytes_element_reader.h" |
20 #include "net/base/upload_data_stream.h" | 18 #include "net/base/upload_data_stream.h" |
21 #include "net/cert/ct_policy_enforcer.h" | 19 #include "net/cert/ct_policy_enforcer.h" |
22 #include "net/cert/mock_cert_verifier.h" | 20 #include "net/cert/mock_cert_verifier.h" |
23 #include "net/cert/multi_log_ct_verifier.h" | 21 #include "net/cert/multi_log_ct_verifier.h" |
24 #include "net/dns/mapped_host_resolver.h" | 22 #include "net/dns/mapped_host_resolver.h" |
25 #include "net/dns/mock_host_resolver.h" | 23 #include "net/dns/mock_host_resolver.h" |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 transaction_factory_.get()); | 267 transaction_factory_.get()); |
270 consumer.Start(&request_, NetLogWithSource()); | 268 consumer.Start(&request_, NetLogWithSource()); |
271 | 269 |
272 // Will terminate when the last consumer completes. | 270 // Will terminate when the last consumer completes. |
273 base::RunLoop().Run(); | 271 base::RunLoop().Run(); |
274 | 272 |
275 CheckResponse(consumer, "HTTP/1.1 200", response); | 273 CheckResponse(consumer, "HTTP/1.1 200", response); |
276 } | 274 } |
277 | 275 |
278 TEST_P(QuicEndToEndTest, TokenBinding) { | 276 TEST_P(QuicEndToEndTest, TokenBinding) { |
279 // Required by ChannelIDService. | |
280 base::test::ScopedTaskScheduler scoped_task_scheduler( | |
281 base::MessageLoop::current()); | |
282 | |
283 // Enable token binding and re-initialize the TestTransactionFactory. | 277 // Enable token binding and re-initialize the TestTransactionFactory. |
284 params_.enable_token_binding = true; | 278 params_.enable_token_binding = true; |
285 transaction_factory_.reset(new TestTransactionFactory(params_)); | 279 transaction_factory_.reset(new TestTransactionFactory(params_)); |
286 | 280 |
287 AddToCache(request_.url.PathForRequest(), 200, "OK", kResponseBody); | 281 AddToCache(request_.url.PathForRequest(), 200, "OK", kResponseBody); |
288 | 282 |
289 TestTransactionConsumer consumer(DEFAULT_PRIORITY, | 283 TestTransactionConsumer consumer(DEFAULT_PRIORITY, |
290 transaction_factory_.get()); | 284 transaction_factory_.get()); |
291 consumer.Start(&request_, NetLogWithSource()); | 285 consumer.Start(&request_, NetLogWithSource()); |
292 | 286 |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 | 356 |
363 // Will terminate when the last consumer completes. | 357 // Will terminate when the last consumer completes. |
364 base::RunLoop().Run(); | 358 base::RunLoop().Run(); |
365 | 359 |
366 for (const auto& consumer : consumers) | 360 for (const auto& consumer : consumers) |
367 CheckResponse(*consumer.get(), "HTTP/1.1 200", kResponseBody); | 361 CheckResponse(*consumer.get(), "HTTP/1.1 200", kResponseBody); |
368 } | 362 } |
369 | 363 |
370 } // namespace test | 364 } // namespace test |
371 } // namespace net | 365 } // namespace net |
OLD | NEW |