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

Unified Diff: chrome/browser/prerender/prerender_interceptor_unittest.cc

Issue 5693001: Fix memory leak in PrerenderInterceptorTest... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years 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
« no previous file with comments | « no previous file | tools/heapcheck/suppressions.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/prerender/prerender_interceptor_unittest.cc
===================================================================
--- chrome/browser/prerender/prerender_interceptor_unittest.cc (revision 68871)
+++ chrome/browser/prerender/prerender_interceptor_unittest.cc (working copy)
@@ -17,7 +17,7 @@
#include "net/url_request/url_request_unittest.h"
class PrerenderInterceptorTest : public testing::Test {
- public:
+ protected:
PrerenderInterceptorTest();
void MakeTestUrl(const std::string& base);
@@ -27,6 +27,7 @@
GURL gurl_;
GURL last_intercepted_gurl_;
scoped_ptr<net::URLRequest> req_;
+
private:
void SetLastInterceptedGurl(const GURL& url);
@@ -34,6 +35,7 @@
MessageLoopForIO io_loop_;
scoped_refptr<base::MessageLoopProxy> io_message_loop_proxy_;
BrowserThread ui_thread_;
+ TestDelegate delegate_for_req_;
};
PrerenderInterceptorTest::PrerenderInterceptorTest()
@@ -57,17 +59,16 @@
void PrerenderInterceptorTest::MakeTestUrl(const std::string& base) {
gurl_ = test_server_.GetURL(base);
- req_.reset(new TestURLRequest(gurl_, new TestDelegate()));
+ req_.reset(new TestURLRequest(gurl_, &delegate_for_req_));
}
void PrerenderInterceptorTest::SetLastInterceptedGurl(const GURL& url) {
last_intercepted_gurl_ = url;
}
-// Temporarily disabling PrerenderInterceptorTest's due to a leak.
-// I have a fix, but will land in the morning.
-// http://crbug.com/65993
-TEST_F(PrerenderInterceptorTest, DISABLED_Interception) {
+namespace {
+
+TEST_F(PrerenderInterceptorTest, Interception) {
MakeTestUrl("files/prerender/doc1.html");
req_->set_load_flags(req_->load_flags() | net::LOAD_PREFETCH);
req_->Start();
@@ -77,7 +78,7 @@
EXPECT_EQ(gurl_, last_intercepted_gurl_);
}
-TEST_F(PrerenderInterceptorTest, DISABLED_NotAPrefetch) {
+TEST_F(PrerenderInterceptorTest, NotAPrefetch) {
MakeTestUrl("files/prerender/doc2.html");
req_->set_load_flags(req_->load_flags() & ~net::LOAD_PREFETCH);
req_->Start();
@@ -87,7 +88,7 @@
EXPECT_NE(gurl_, last_intercepted_gurl_);
}
-TEST_F(PrerenderInterceptorTest, DISABLED_WrongMimeType) {
+TEST_F(PrerenderInterceptorTest, WrongMimeType) {
MakeTestUrl("files/prerender/image.jpeg");
req_->set_load_flags(req_->load_flags() | net::LOAD_PREFETCH);
req_->Start();
@@ -97,3 +98,4 @@
EXPECT_NE(gurl_, last_intercepted_gurl_);
}
+} // namespace
« no previous file with comments | « no previous file | tools/heapcheck/suppressions.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698