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

Unified Diff: webkit/glue/resource_fetcher_unittest.cc

Issue 17030: Revert 7508.7509 and 7510 (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 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 | « webkit/glue/mimetype_unittest.cc ('k') | webkit/glue/unittest_test_server.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/resource_fetcher_unittest.cc
===================================================================
--- webkit/glue/resource_fetcher_unittest.cc (revision 7513)
+++ webkit/glue/resource_fetcher_unittest.cc (working copy)
@@ -153,16 +153,14 @@
// Test a fetch from the test server.
TEST_F(ResourceFetcherTests, ResourceFetcherDownload) {
- scoped_refptr<UnittestTestServer> server =
- UnittestTestServer::CreateServer();
- ASSERT_TRUE(NULL != server.get());
+ UnittestTestServer server;
WebFrame* web_frame = test_shell_->webView()->GetMainFrame();
// Not safe, but this is a unittest, so whatever.
WebFrameImpl* web_frame_impl = reinterpret_cast<WebFrameImpl*>(web_frame);
WebCore::Frame* frame = web_frame_impl->frame();
- GURL url = server->TestServerPage("files/test_shell/index.html");
+ GURL url = server.TestServerPage("files/test_shell/index.html");
scoped_ptr<FetcherDelegate> delegate(new FetcherDelegate);
scoped_ptr<ResourceFetcher> fetcher(new ResourceFetcher(
url, frame, delegate.get()));
@@ -175,7 +173,7 @@
EXPECT_TRUE(text.find("What is this page?") != std::string::npos);
// Test 404 response.
- url = server->TestServerPage("files/thisfiledoesntexist.html");
+ url = server.TestServerPage("files/thisfiledoesntexist.html");
delegate.reset(new FetcherDelegate);
fetcher.reset(new ResourceFetcher(url, frame, delegate.get()));
@@ -187,10 +185,7 @@
}
TEST_F(ResourceFetcherTests, ResourceFetcherDidFail) {
- scoped_refptr<UnittestTestServer> server =
- UnittestTestServer::CreateServer();
- ASSERT_TRUE(NULL != server.get());
-
+ UnittestTestServer server;
WebFrame* web_frame = test_shell_->webView()->GetMainFrame();
// Not safe, but this is a unittest, so whatever.
WebFrameImpl* web_frame_impl = reinterpret_cast<WebFrameImpl*>(web_frame);
@@ -213,9 +208,7 @@
}
TEST_F(ResourceFetcherTests, ResourceFetcherTimeout) {
- scoped_refptr<UnittestTestServer> server =
- UnittestTestServer::CreateServer();
- ASSERT_TRUE(NULL != server.get());
+ UnittestTestServer server;
WebFrame* web_frame = test_shell_->webView()->GetMainFrame();
// Not safe, but this is a unittest, so whatever.
@@ -224,7 +217,7 @@
// Grab a page that takes at least 1 sec to respond, but set the fetcher to
// timeout in 0 sec.
- GURL url = server->TestServerPage("slow?1");
+ GURL url = server.TestServerPage("slow?1");
scoped_ptr<FetcherDelegate> delegate(new FetcherDelegate);
scoped_ptr<ResourceFetcher> fetcher(new ResourceFetcherWithTimeout(
url, frame, 0, delegate.get()));
« no previous file with comments | « webkit/glue/mimetype_unittest.cc ('k') | webkit/glue/unittest_test_server.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698