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

Unified Diff: net/url_request/url_request_throttler_unittest.cc

Issue 10559036: Added URLRequestContext to constructor for URLRequest. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Updated unittests Created 8 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: net/url_request/url_request_throttler_unittest.cc
diff --git a/net/url_request/url_request_throttler_unittest.cc b/net/url_request/url_request_throttler_unittest.cc
index 9a6079d1a122d89a95622f6d552812a9907f4fff..2e7bd0d52dd8bbb0f7819fcca1f4aaeda85573ab 100644
--- a/net/url_request/url_request_throttler_unittest.cc
+++ b/net/url_request/url_request_throttler_unittest.cc
@@ -167,7 +167,7 @@ struct GurlAndString {
class URLRequestThrottlerEntryTest : public testing::Test {
protected:
- URLRequestThrottlerEntryTest() : request_(GURL(), NULL) {
+ URLRequestThrottlerEntryTest() : request_(GURL(), NULL, &context_) {
}
virtual void SetUp();
@@ -183,6 +183,8 @@ class URLRequestThrottlerEntryTest : public testing::Test {
std::map<std::string, Histogram::SampleSet> original_samples_;
std::map<std::string, Histogram::SampleSet> samples_;
+ // Order matters: context_ must be declared before request_.
+ TestURLRequestContext context_;
TestURLRequest request_;
};
@@ -379,13 +381,15 @@ TEST_F(URLRequestThrottlerEntryTest, ExplicitUserRequest) {
class URLRequestThrottlerManagerTest : public testing::Test {
protected:
URLRequestThrottlerManagerTest()
- : request_(GURL(), NULL) {
+ : request_(GURL(), NULL, &context_) {
}
virtual void SetUp() {
request_.set_load_flags(0);
}
+ // context_ must be declared before request_.
+ TestURLRequestContext context_;
TestURLRequest request_;
};

Powered by Google App Engine
This is Rietveld 408576698