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 <stdint.h> |
| 6 |
5 #include <map> | 7 #include <map> |
6 #include <string> | 8 #include <string> |
7 | 9 |
| 10 #include "base/macros.h" |
8 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
9 #include "chrome/renderer/extensions/extension_localization_peer.h" | 12 #include "chrome/renderer/extensions/extension_localization_peer.h" |
10 #include "content/public/child/fixed_received_data.h" | 13 #include "content/public/child/fixed_received_data.h" |
11 #include "extensions/common/message_bundle.h" | 14 #include "extensions/common/message_bundle.h" |
12 #include "ipc/ipc_sender.h" | 15 #include "ipc/ipc_sender.h" |
13 #include "ipc/ipc_sync_message.h" | 16 #include "ipc/ipc_sync_message.h" |
14 #include "net/base/net_errors.h" | 17 #include "net/base/net_errors.h" |
15 #include "net/url_request/redirect_info.h" | 18 #include "net/url_request/redirect_info.h" |
16 #include "net/url_request/url_request_status.h" | 19 #include "net/url_request/url_request_status.h" |
17 #include "testing/gmock/include/gmock/gmock.h" | 20 #include "testing/gmock/include/gmock/gmock.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 | 54 |
52 private: | 55 private: |
53 DISALLOW_COPY_AND_ASSIGN(MockIpcMessageSender); | 56 DISALLOW_COPY_AND_ASSIGN(MockIpcMessageSender); |
54 }; | 57 }; |
55 | 58 |
56 class MockRequestPeer : public content::RequestPeer { | 59 class MockRequestPeer : public content::RequestPeer { |
57 public: | 60 public: |
58 MockRequestPeer() {} | 61 MockRequestPeer() {} |
59 virtual ~MockRequestPeer() {} | 62 virtual ~MockRequestPeer() {} |
60 | 63 |
61 MOCK_METHOD2(OnUploadProgress, void(uint64 position, uint64 size)); | 64 MOCK_METHOD2(OnUploadProgress, void(uint64_t position, uint64_t size)); |
62 MOCK_METHOD2(OnReceivedRedirect, | 65 MOCK_METHOD2(OnReceivedRedirect, |
63 bool(const net::RedirectInfo& redirect_info, | 66 bool(const net::RedirectInfo& redirect_info, |
64 const content::ResourceResponseInfo& info)); | 67 const content::ResourceResponseInfo& info)); |
65 MOCK_METHOD1(OnReceivedResponse, | 68 MOCK_METHOD1(OnReceivedResponse, |
66 void(const content::ResourceResponseInfo& info)); | 69 void(const content::ResourceResponseInfo& info)); |
67 MOCK_METHOD2(OnDownloadedData, void(int len, int encoded_data_length)); | 70 MOCK_METHOD2(OnDownloadedData, void(int len, int encoded_data_length)); |
68 void OnReceivedData(scoped_ptr<RequestPeer::ReceivedData> data) override { | 71 void OnReceivedData(scoped_ptr<RequestPeer::ReceivedData> data) override { |
69 OnReceivedDataInternal(data->payload(), data->length(), | 72 OnReceivedDataInternal(data->payload(), data->length(), |
70 data->encoded_length()); | 73 data->encoded_length()); |
71 } | 74 } |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 EXPECT_CALL(*sender_, Send(_)).Times(0); | 279 EXPECT_CALL(*sender_, Send(_)).Times(0); |
277 | 280 |
278 EXPECT_CALL(*original_peer_, | 281 EXPECT_CALL(*original_peer_, |
279 OnReceivedCompletedResponseInternal( | 282 OnReceivedCompletedResponseInternal( |
280 _, StrEq(message.c_str()), message.size(), -1, net::OK, false, | 283 _, StrEq(message.c_str()), message.size(), -1, net::OK, false, |
281 false, "", base::TimeTicks(), -1)); | 284 false, "", base::TimeTicks(), -1)); |
282 | 285 |
283 filter_peer->OnCompletedRequest( | 286 filter_peer->OnCompletedRequest( |
284 net::OK, false, false, std::string(), base::TimeTicks(), -1); | 287 net::OK, false, false, std::string(), base::TimeTicks(), -1); |
285 } | 288 } |
OLD | NEW |