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

Side by Side Diff: chrome/browser/extensions/api/web_request/web_request_api_unittest.cc

Issue 63933003: Moved ExtensionInfoMap and ExtensionsQuotaService to extensions/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comment fix Created 7 years, 1 month 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <queue> 6 #include <queue>
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 namespace web_request = extensions::api::web_request; 57 namespace web_request = extensions::api::web_request;
58 58
59 using base::BinaryValue; 59 using base::BinaryValue;
60 using base::DictionaryValue; 60 using base::DictionaryValue;
61 using base::ListValue; 61 using base::ListValue;
62 using base::StringValue; 62 using base::StringValue;
63 using base::Time; 63 using base::Time;
64 using base::TimeDelta; 64 using base::TimeDelta;
65 using base::Value; 65 using base::Value;
66 using chrome::VersionInfo; 66 using chrome::VersionInfo;
67 using extensions::Feature;
68 using helpers::CalculateOnAuthRequiredDelta; 67 using helpers::CalculateOnAuthRequiredDelta;
69 using helpers::CalculateOnBeforeRequestDelta; 68 using helpers::CalculateOnBeforeRequestDelta;
70 using helpers::CalculateOnBeforeSendHeadersDelta; 69 using helpers::CalculateOnBeforeSendHeadersDelta;
71 using helpers::CalculateOnHeadersReceivedDelta; 70 using helpers::CalculateOnHeadersReceivedDelta;
72 using helpers::CharListToString; 71 using helpers::CharListToString;
73 using helpers::EventResponseDelta; 72 using helpers::EventResponseDelta;
74 using helpers::EventResponseDeltas; 73 using helpers::EventResponseDeltas;
75 using helpers::EventResponseDeltas; 74 using helpers::EventResponseDeltas;
76 using helpers::InDecreasingExtensionInstallationTimeOrder; 75 using helpers::InDecreasingExtensionInstallationTimeOrder;
77 using helpers::MergeCancelOfResponses; 76 using helpers::MergeCancelOfResponses;
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 const std::vector<char>& bytes_1, 201 const std::vector<char>& bytes_1,
203 const std::vector<char>& bytes_2); 202 const std::vector<char>& bytes_2);
204 203
205 content::TestBrowserThreadBundle thread_bundle_; 204 content::TestBrowserThreadBundle thread_bundle_;
206 TestingProfile profile_; 205 TestingProfile profile_;
207 TestingProfileManager profile_manager_; 206 TestingProfileManager profile_manager_;
208 net::TestDelegate delegate_; 207 net::TestDelegate delegate_;
209 BooleanPrefMember enable_referrers_; 208 BooleanPrefMember enable_referrers_;
210 TestIPCSender ipc_sender_; 209 TestIPCSender ipc_sender_;
211 scoped_refptr<EventRouterForwarder> event_router_; 210 scoped_refptr<EventRouterForwarder> event_router_;
212 scoped_refptr<ExtensionInfoMap> extension_info_map_; 211 scoped_refptr<InfoMap> extension_info_map_;
213 scoped_ptr<ChromeNetworkDelegate> network_delegate_; 212 scoped_ptr<ChromeNetworkDelegate> network_delegate_;
214 scoped_ptr<net::TestURLRequestContext> context_; 213 scoped_ptr<net::TestURLRequestContext> context_;
215 }; 214 };
216 215
217 // Tests that we handle disagreements among extensions about responses to 216 // Tests that we handle disagreements among extensions about responses to
218 // blocking events (redirection) by choosing the response from the 217 // blocking events (redirection) by choosing the response from the
219 // most-recently-installed extension. 218 // most-recently-installed extension.
220 TEST_F(ExtensionWebRequestTest, BlockingEventPrecedenceRedirect) { 219 TEST_F(ExtensionWebRequestTest, BlockingEventPrecedenceRedirect) {
221 std::string extension1_id("1"); 220 std::string extension1_id("1");
222 std::string extension2_id("2"); 221 std::string extension2_id("2");
(...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after
796 context_->Init(); 795 context_->Init();
797 } 796 }
798 797
799 content::TestBrowserThreadBundle thread_bundle_; 798 content::TestBrowserThreadBundle thread_bundle_;
800 TestingProfile profile_; 799 TestingProfile profile_;
801 TestingProfileManager profile_manager_; 800 TestingProfileManager profile_manager_;
802 net::TestDelegate delegate_; 801 net::TestDelegate delegate_;
803 BooleanPrefMember enable_referrers_; 802 BooleanPrefMember enable_referrers_;
804 TestIPCSender ipc_sender_; 803 TestIPCSender ipc_sender_;
805 scoped_refptr<EventRouterForwarder> event_router_; 804 scoped_refptr<EventRouterForwarder> event_router_;
806 scoped_refptr<ExtensionInfoMap> extension_info_map_; 805 scoped_refptr<InfoMap> extension_info_map_;
807 scoped_ptr<ChromeNetworkDelegate> network_delegate_; 806 scoped_ptr<ChromeNetworkDelegate> network_delegate_;
808 scoped_ptr<net::MockHostResolver> host_resolver_; 807 scoped_ptr<net::MockHostResolver> host_resolver_;
809 scoped_ptr<net::TestURLRequestContext> context_; 808 scoped_ptr<net::TestURLRequestContext> context_;
810 }; 809 };
811 810
812 TEST_P(ExtensionWebRequestHeaderModificationTest, TestModifications) { 811 TEST_P(ExtensionWebRequestHeaderModificationTest, TestModifications) {
813 std::string extension1_id("1"); 812 std::string extension1_id("1");
814 std::string extension2_id("2"); 813 std::string extension2_id("2");
815 std::string extension3_id("3"); 814 std::string extension3_id("3");
816 ExtensionWebRequestEventRouter::RequestFilter filter; 815 ExtensionWebRequestEventRouter::RequestFilter filter;
(...skipping 1321 matching lines...) Expand 10 before | Expand all | Expand 10 after
2138 EXPECT_TRUE(credentials_set); 2137 EXPECT_TRUE(credentials_set);
2139 EXPECT_FALSE(auth3.Empty()); 2138 EXPECT_FALSE(auth3.Empty());
2140 EXPECT_EQ(username, auth1.username()); 2139 EXPECT_EQ(username, auth1.username());
2141 EXPECT_EQ(password, auth1.password()); 2140 EXPECT_EQ(password, auth1.password());
2142 EXPECT_EQ(1u, warning_set.size()); 2141 EXPECT_EQ(1u, warning_set.size());
2143 EXPECT_TRUE(HasWarning(warning_set, "extid2")); 2142 EXPECT_TRUE(HasWarning(warning_set, "extid2"));
2144 EXPECT_EQ(3u, capturing_net_log.GetSize()); 2143 EXPECT_EQ(3u, capturing_net_log.GetSize());
2145 } 2144 }
2146 2145
2147 } // namespace extensions 2146 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698