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