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 "net/http/http_transaction_test_util.h" | 5 #include "net/http/http_transaction_test_util.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <unordered_map> | |
9 #include <utility> | 8 #include <utility> |
10 | 9 |
11 #include "base/bind.h" | 10 #include "base/bind.h" |
12 #include "base/location.h" | 11 #include "base/location.h" |
13 #include "base/message_loop/message_loop.h" | 12 #include "base/message_loop/message_loop.h" |
14 #include "base/single_thread_task_runner.h" | 13 #include "base/single_thread_task_runner.h" |
15 #include "base/strings/stringprintf.h" | 14 #include "base/strings/stringprintf.h" |
16 #include "base/thread_task_runner_handle.h" | 15 #include "base/thread_task_runner_handle.h" |
17 #include "base/time/clock.h" | 16 #include "base/time/clock.h" |
18 #include "base/time/time.h" | 17 #include "base/time/time.h" |
19 #include "net/base/load_flags.h" | 18 #include "net/base/load_flags.h" |
20 #include "net/base/load_timing_info.h" | 19 #include "net/base/load_timing_info.h" |
21 #include "net/base/net_errors.h" | 20 #include "net/base/net_errors.h" |
22 #include "net/cert/x509_certificate.h" | 21 #include "net/cert/x509_certificate.h" |
23 #include "net/disk_cache/disk_cache.h" | 22 #include "net/disk_cache/disk_cache.h" |
24 #include "net/http/http_cache.h" | 23 #include "net/http/http_cache.h" |
25 #include "net/http/http_request_info.h" | 24 #include "net/http/http_request_info.h" |
26 #include "net/http/http_response_info.h" | 25 #include "net/http/http_response_info.h" |
27 #include "net/http/http_transaction.h" | 26 #include "net/http/http_transaction.h" |
28 #include "testing/gtest/include/gtest/gtest.h" | 27 #include "testing/gtest/include/gtest/gtest.h" |
29 | 28 |
30 namespace net { | 29 namespace net { |
31 | 30 |
32 namespace { | 31 namespace { |
33 using MockTransactionMap = | 32 typedef base::hash_map<std::string, const MockTransaction*> MockTransactionMap; |
34 std::unordered_map<std::string, const MockTransaction*>; | |
35 static MockTransactionMap mock_transactions; | 33 static MockTransactionMap mock_transactions; |
36 } // namespace | 34 } // namespace |
37 | 35 |
38 //----------------------------------------------------------------------------- | 36 //----------------------------------------------------------------------------- |
39 // mock transaction data | 37 // mock transaction data |
40 | 38 |
41 const MockTransaction kSimpleGET_Transaction = { | 39 const MockTransaction kSimpleGET_Transaction = { |
42 "http://www.google.com/", | 40 "http://www.google.com/", |
43 "GET", | 41 "GET", |
44 base::Time(), | 42 base::Time(), |
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
570 content.append(buf->data(), rv); | 568 content.append(buf->data(), rv); |
571 else if (rv < 0) | 569 else if (rv < 0) |
572 return rv; | 570 return rv; |
573 } while (rv > 0); | 571 } while (rv > 0); |
574 | 572 |
575 result->swap(content); | 573 result->swap(content); |
576 return OK; | 574 return OK; |
577 } | 575 } |
578 | 576 |
579 } // namespace net | 577 } // namespace net |
OLD | NEW |