Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1391)

Side by Side Diff: chrome/renderer/extensions/extension_localization_peer_unittest.cc

Issue 398903002: Plumb redirect info out of net, through content, and into child processes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: darin comments Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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"
11 #include "ipc/ipc_sender.h" 11 #include "ipc/ipc_sender.h"
12 #include "ipc/ipc_sync_message.h" 12 #include "ipc/ipc_sync_message.h"
13 #include "net/base/net_errors.h" 13 #include "net/base/net_errors.h"
14 #include "net/url_request/redirect_info.h"
14 #include "net/url_request/url_request_status.h" 15 #include "net/url_request/url_request_status.h"
15 #include "testing/gmock/include/gmock/gmock.h" 16 #include "testing/gmock/include/gmock/gmock.h"
16 #include "testing/gtest/include/gtest/gtest.h" 17 #include "testing/gtest/include/gtest/gtest.h"
17 18
18 using testing::_; 19 using testing::_;
19 using testing::DoAll; 20 using testing::DoAll;
20 using testing::Invoke; 21 using testing::Invoke;
21 using testing::StrEq; 22 using testing::StrEq;
22 using testing::Return; 23 using testing::Return;
23 24
(...skipping 24 matching lines...) Expand all
48 private: 49 private:
49 DISALLOW_COPY_AND_ASSIGN(MockIpcMessageSender); 50 DISALLOW_COPY_AND_ASSIGN(MockIpcMessageSender);
50 }; 51 };
51 52
52 class MockRequestPeer : public content::RequestPeer { 53 class MockRequestPeer : public content::RequestPeer {
53 public: 54 public:
54 MockRequestPeer() {} 55 MockRequestPeer() {}
55 virtual ~MockRequestPeer() {} 56 virtual ~MockRequestPeer() {}
56 57
57 MOCK_METHOD2(OnUploadProgress, void(uint64 position, uint64 size)); 58 MOCK_METHOD2(OnUploadProgress, void(uint64 position, uint64 size));
58 MOCK_METHOD3(OnReceivedRedirect, 59 MOCK_METHOD2(OnReceivedRedirect,
59 bool(const GURL& new_url, 60 bool(const net::RedirectInfo& redirect_info,
60 const GURL& new_first_party_for_cookies,
61 const content::ResourceResponseInfo& info)); 61 const content::ResourceResponseInfo& info));
62 MOCK_METHOD1(OnReceivedResponse, 62 MOCK_METHOD1(OnReceivedResponse,
63 void(const content::ResourceResponseInfo& info)); 63 void(const content::ResourceResponseInfo& info));
64 MOCK_METHOD2(OnDownloadedData, void(int len, int encoded_data_length)); 64 MOCK_METHOD2(OnDownloadedData, void(int len, int encoded_data_length));
65 MOCK_METHOD3(OnReceivedData, void(const char* data, 65 MOCK_METHOD3(OnReceivedData, void(const char* data,
66 int data_length, 66 int data_length,
67 int encoded_data_length)); 67 int encoded_data_length));
68 MOCK_METHOD6(OnCompletedRequest, void( 68 MOCK_METHOD6(OnCompletedRequest, void(
69 int error_code, 69 int error_code,
70 bool was_ignored_by_handler, 70 bool was_ignored_by_handler,
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 EXPECT_CALL(*original_peer_, 240 EXPECT_CALL(*original_peer_,
241 OnReceivedData(StrEq(message.data()), message.length(), -1)); 241 OnReceivedData(StrEq(message.data()), message.length(), -1));
242 242
243 EXPECT_CALL(*original_peer_, OnReceivedResponse(_)); 243 EXPECT_CALL(*original_peer_, OnReceivedResponse(_));
244 EXPECT_CALL(*original_peer_, OnCompletedRequest( 244 EXPECT_CALL(*original_peer_, OnCompletedRequest(
245 net::OK, false, false, "", base::TimeTicks(), -1)); 245 net::OK, false, false, "", base::TimeTicks(), -1));
246 246
247 filter_peer->OnCompletedRequest( 247 filter_peer->OnCompletedRequest(
248 net::OK, false, false, std::string(), base::TimeTicks(), -1); 248 net::OK, false, false, std::string(), base::TimeTicks(), -1);
249 } 249 }
OLDNEW
« no previous file with comments | « chrome/renderer/extensions/extension_localization_peer.cc ('k') | chrome/renderer/security_filter_peer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698