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 <map> | 5 #include <map> |
6 #include <string> | 6 #include <string> |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "chrome/renderer/extensions/extension_localization_peer.h" | 9 #include "chrome/renderer/extensions/extension_localization_peer.h" |
10 #include "extensions/common/message_bundle.h" | 10 #include "extensions/common/message_bundle.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 private: | 49 private: |
50 DISALLOW_COPY_AND_ASSIGN(MockIpcMessageSender); | 50 DISALLOW_COPY_AND_ASSIGN(MockIpcMessageSender); |
51 }; | 51 }; |
52 | 52 |
53 class MockResourceLoaderBridgePeer : public content::RequestPeer { | 53 class MockResourceLoaderBridgePeer : public content::RequestPeer { |
54 public: | 54 public: |
55 MockResourceLoaderBridgePeer() {} | 55 MockResourceLoaderBridgePeer() {} |
56 virtual ~MockResourceLoaderBridgePeer() {} | 56 virtual ~MockResourceLoaderBridgePeer() {} |
57 | 57 |
58 MOCK_METHOD2(OnUploadProgress, void(uint64 position, uint64 size)); | 58 MOCK_METHOD2(OnUploadProgress, void(uint64 position, uint64 size)); |
59 MOCK_METHOD4(OnReceivedRedirect, bool( | 59 MOCK_METHOD3(OnReceivedRedirect, |
60 const GURL& new_url, | 60 bool(const GURL& new_url, |
61 const webkit_glue::ResourceResponseInfo& info, | 61 const GURL& new_first_party_for_cookies, |
62 bool* has_new_first_party_for_cookies, | 62 const webkit_glue::ResourceResponseInfo& info)); |
63 GURL* new_first_party_for_cookies)); | |
64 MOCK_METHOD1(OnReceivedResponse, void( | 63 MOCK_METHOD1(OnReceivedResponse, void( |
65 const webkit_glue::ResourceResponseInfo& info)); | 64 const webkit_glue::ResourceResponseInfo& info)); |
66 MOCK_METHOD2(OnDownloadedData, void(int len, int encoded_data_length)); | 65 MOCK_METHOD2(OnDownloadedData, void(int len, int encoded_data_length)); |
67 MOCK_METHOD3(OnReceivedData, void(const char* data, | 66 MOCK_METHOD3(OnReceivedData, void(const char* data, |
68 int data_length, | 67 int data_length, |
69 int encoded_data_length)); | 68 int encoded_data_length)); |
70 MOCK_METHOD6(OnCompletedRequest, void( | 69 MOCK_METHOD6(OnCompletedRequest, void( |
71 int error_code, | 70 int error_code, |
72 bool was_ignored_by_handler, | 71 bool was_ignored_by_handler, |
73 bool stale_copy_in_cache, | 72 bool stale_copy_in_cache, |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 EXPECT_CALL(*original_peer_, | 241 EXPECT_CALL(*original_peer_, |
243 OnReceivedData(StrEq(message.data()), message.length(), -1)); | 242 OnReceivedData(StrEq(message.data()), message.length(), -1)); |
244 | 243 |
245 EXPECT_CALL(*original_peer_, OnReceivedResponse(_)); | 244 EXPECT_CALL(*original_peer_, OnReceivedResponse(_)); |
246 EXPECT_CALL(*original_peer_, OnCompletedRequest( | 245 EXPECT_CALL(*original_peer_, OnCompletedRequest( |
247 net::OK, false, false, "", base::TimeTicks(), -1)); | 246 net::OK, false, false, "", base::TimeTicks(), -1)); |
248 | 247 |
249 filter_peer->OnCompletedRequest( | 248 filter_peer->OnCompletedRequest( |
250 net::OK, false, false, std::string(), base::TimeTicks(), -1); | 249 net::OK, false, false, std::string(), base::TimeTicks(), -1); |
251 } | 250 } |
OLD | NEW |