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