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

Side by Side Diff: net/url_request/view_cache_helper_unittest.cc

Issue 379293002: Add AssertNoURLRequests() to URLRequestContext subclass destructors. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add to two omitted subclasses of subclasses of URLRequestContext. Created 6 years, 5 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
« no previous file with comments | « net/url_request/url_request_test_util.cc ('k') | net/websockets/websocket_job_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "net/url_request/view_cache_helper.h" 5 #include "net/url_request/view_cache_helper.h"
6 6
7 #include "base/pickle.h" 7 #include "base/pickle.h"
8 #include "net/base/net_errors.h" 8 #include "net/base/net_errors.h"
9 #include "net/base/test_completion_callback.h" 9 #include "net/base/test_completion_callback.h"
10 #include "net/disk_cache/disk_cache.h" 10 #include "net/disk_cache/disk_cache.h"
11 #include "net/http/http_cache.h" 11 #include "net/http/http_cache.h"
12 #include "net/http/http_transaction_test_util.h" 12 #include "net/http/http_transaction_test_util.h"
13 #include "net/url_request/url_request_context.h" 13 #include "net/url_request/url_request_context.h"
14 #include "testing/gtest/include/gtest/gtest.h" 14 #include "testing/gtest/include/gtest/gtest.h"
15 15
16 namespace net { 16 namespace net {
17 17
18 namespace { 18 namespace {
19 19
20 class TestURLRequestContext : public URLRequestContext { 20 class TestURLRequestContext : public URLRequestContext {
21 public: 21 public:
22 TestURLRequestContext(); 22 TestURLRequestContext();
23 virtual ~TestURLRequestContext() {} 23
24 virtual ~TestURLRequestContext() {
25 AssertNoURLRequests();
26 }
24 27
25 // Gets a pointer to the cache backend. 28 // Gets a pointer to the cache backend.
26 disk_cache::Backend* GetBackend(); 29 disk_cache::Backend* GetBackend();
27 30
28 private: 31 private:
29 HttpCache cache_; 32 HttpCache cache_;
30 }; 33 };
31 34
32 TestURLRequestContext::TestURLRequestContext() 35 TestURLRequestContext::TestURLRequestContext()
33 : cache_(new MockNetworkLayer(), NULL, 36 : cache_(new MockNetworkLayer(), NULL,
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 206
204 std::string data; 207 std::string data;
205 TestCompletionCallback cb1; 208 TestCompletionCallback cb1;
206 rv = helper.GetEntryInfoHTML(key, &context, &data, cb1.callback()); 209 rv = helper.GetEntryInfoHTML(key, &context, &data, cb1.callback());
207 EXPECT_EQ(OK, cb1.GetResult(rv)); 210 EXPECT_EQ(OK, cb1.GetResult(rv));
208 211
209 EXPECT_NE(std::string::npos, data.find("RESPONSE_INFO_TRUNCATED")); 212 EXPECT_NE(std::string::npos, data.find("RESPONSE_INFO_TRUNCATED"));
210 } 213 }
211 214
212 } // namespace net 215 } // namespace net
OLDNEW
« no previous file with comments | « net/url_request/url_request_test_util.cc ('k') | net/websockets/websocket_job_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698