| Index: content/child/resource_dispatcher_unittest.cc
|
| diff --git a/content/child/resource_dispatcher_unittest.cc b/content/child/resource_dispatcher_unittest.cc
|
| index b12db6b290451621d8af2ba7e9b6563bbfbdeaf4..a860174511515ef641c02703dbfab858a2b42f34 100644
|
| --- a/content/child/resource_dispatcher_unittest.cc
|
| +++ b/content/child/resource_dispatcher_unittest.cc
|
| @@ -19,7 +19,6 @@
|
| #include "net/base/net_errors.h"
|
| #include "net/http/http_response_headers.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
| -#include "webkit/child/resource_loader_bridge.h"
|
| #include "webkit/common/appcache/appcache_interfaces.h"
|
|
|
| using webkit_glue::ResourceLoaderBridge;
|
| @@ -164,7 +163,7 @@ class ResourceDispatcherTest : public testing::Test, public IPC::Sender {
|
| dispatcher_.reset();
|
| }
|
|
|
| - ResourceLoaderBridge* CreateBridge() {
|
| + void CreateBridge() {
|
| RequestInfo request_info;
|
| request_info.method = "GET";
|
| request_info.url = GURL(test_page_url);
|
| @@ -179,22 +178,22 @@ class ResourceDispatcherTest : public testing::Test, public IPC::Sender {
|
| RequestExtraData extra_data;
|
| request_info.extra_data = &extra_data;
|
|
|
| - return dispatcher_->CreateBridge(request_info);
|
| + dispatcher_->CreateBridge(request_info);
|
| }
|
|
|
| std::vector<IPC::Message> message_queue_;
|
| static scoped_ptr<ResourceDispatcher> dispatcher_;
|
| };
|
|
|
| -/*static*/
|
| +// static
|
| scoped_ptr<ResourceDispatcher> ResourceDispatcherTest::dispatcher_;
|
|
|
| // Does a simple request and tests that the correct data is received.
|
| TEST_F(ResourceDispatcherTest, RoundTrip) {
|
| TestRequestCallback callback;
|
| - ResourceLoaderBridge* bridge = CreateBridge();
|
| + CreateBridge();
|
|
|
| - bridge->Start(&callback);
|
| + dispatcher_->Start(&callback);
|
|
|
| ProcessMessages();
|
|
|
| @@ -203,8 +202,6 @@ TEST_F(ResourceDispatcherTest, RoundTrip) {
|
| //EXPECT_TRUE(callback.complete());
|
| //EXPECT_STREQ(test_page_contents, callback.data().c_str());
|
| //EXPECT_EQ(test_page_contents_len, callback.total_encoded_data_length());
|
| -
|
| - delete bridge;
|
| }
|
|
|
| // Tests that the request IDs are straight when there are multiple requests.
|
| @@ -329,14 +326,13 @@ class DeferredResourceLoadingTest : public ResourceDispatcherTest,
|
| TEST_F(DeferredResourceLoadingTest, DeferredLoadTest) {
|
| base::MessageLoopForIO message_loop;
|
|
|
| - ResourceLoaderBridge* bridge = CreateBridge();
|
| + CreateBridge();
|
| + dispatcher_->Start(this);
|
|
|
| - bridge->Start(this);
|
| InitMessages();
|
|
|
| // Dispatch deferred messages.
|
| message_loop.RunUntilIdle();
|
| - delete bridge;
|
| }
|
|
|
| class TimeConversionTest : public ResourceDispatcherTest,
|
| @@ -348,8 +344,8 @@ class TimeConversionTest : public ResourceDispatcherTest,
|
| }
|
|
|
| void PerformTest(const ResourceResponseHead& response_head) {
|
| - scoped_ptr<ResourceLoaderBridge> bridge(CreateBridge());
|
| - bridge->Start(this);
|
| + CreateBridge();
|
| + dispatcher_->Start(this);
|
|
|
| dispatcher_->OnMessageReceived(
|
| ResourceMsg_ReceivedResponse(0, response_head));
|
|
|