summaryrefslogtreecommitdiffstats
path: root/webkit/glue/resource_fetcher_unittest.cc
diff options
context:
space:
mode:
authornsylvain@chromium.org <nsylvain@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-30 23:29:54 +0000
committernsylvain@chromium.org <nsylvain@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-30 23:29:54 +0000
commit5d9c52a60b5e91819c2664572a6e0ef343a3ea28 (patch)
tree30406e4c144cf8d036a4ef1e4dabebcc1b6a8e05 /webkit/glue/resource_fetcher_unittest.cc
parent997c8ca739b3f79ff76adbbf421c7056af8ccdcb (diff)
downloadchromium_src-5d9c52a60b5e91819c2664572a6e0ef343a3ea28.zip
chromium_src-5d9c52a60b5e91819c2664572a6e0ef343a3ea28.tar.gz
chromium_src-5d9c52a60b5e91819c2664572a6e0ef343a3ea28.tar.bz2
Revert 7508.7509 and 7510
Review URL: http://codereview.chromium.org/17030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7514 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/resource_fetcher_unittest.cc')
-rw-r--r--webkit/glue/resource_fetcher_unittest.cc19
1 files changed, 6 insertions, 13 deletions
diff --git a/webkit/glue/resource_fetcher_unittest.cc b/webkit/glue/resource_fetcher_unittest.cc
index 81d9646..d996f3b 100644
--- a/webkit/glue/resource_fetcher_unittest.cc
+++ b/webkit/glue/resource_fetcher_unittest.cc
@@ -153,16 +153,14 @@ FetcherDelegate* FetcherDelegate::instance_ = NULL;
// 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 @@ TEST_F(ResourceFetcherTests, ResourceFetcherDownload) {
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, ResourceFetcherDownload) {
}
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, ResourceFetcherDidFail) {
}
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 @@ TEST_F(ResourceFetcherTests, ResourceFetcherTimeout) {
// 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()));