summaryrefslogtreecommitdiffstats
path: root/content/child/resource_dispatcher_unittest.cc
diff options
context:
space:
mode:
authortfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-02 22:40:51 +0000
committertfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-02 22:40:51 +0000
commit3f0aa2d85a2934f51457a353ca1a13ca15d5b407 (patch)
tree24a77f8f8c0b41d4afebfa6a333a50cafa595a37 /content/child/resource_dispatcher_unittest.cc
parentbcfa9da1ecb3a1859ccad7cca6aa61e15a0a78fe (diff)
downloadchromium_src-3f0aa2d85a2934f51457a353ca1a13ca15d5b407.zip
chromium_src-3f0aa2d85a2934f51457a353ca1a13ca15d5b407.tar.gz
chromium_src-3f0aa2d85a2934f51457a353ca1a13ca15d5b407.tar.bz2
Remove webkit's ResourceLoaderBridge interface.
ResourceLoaderBridge was originally created to bridge code in //webkit that talked to WebURLLoaderImpl (which talked to Blink) with code in ResourceDispatcher in content which used IPC. Now that WebURLLoaderImpl is in content/child, we don't need this interface anymore. As requested by John in - https://codereview.chromium.org/186193005/diff/1/content/public/child/resource_loader_bridge.h#newcode42 BUG=265753,338338,237249 TEST=content_unittests R=jam@chromium.org TBR=darin Review URL: https://codereview.chromium.org/226273005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@267947 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/child/resource_dispatcher_unittest.cc')
-rw-r--r--content/child/resource_dispatcher_unittest.cc52
1 files changed, 24 insertions, 28 deletions
diff --git a/content/child/resource_dispatcher_unittest.cc b/content/child/resource_dispatcher_unittest.cc
index b12db6b..2781387 100644
--- a/content/child/resource_dispatcher_unittest.cc
+++ b/content/child/resource_dispatcher_unittest.cc
@@ -19,10 +19,8 @@
#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;
using webkit_glue::ResourceResponseInfo;
namespace content {
@@ -164,37 +162,37 @@ class ResourceDispatcherTest : public testing::Test, public IPC::Sender {
dispatcher_.reset();
}
- ResourceLoaderBridge* CreateBridge() {
- RequestInfo request_info;
- request_info.method = "GET";
- request_info.url = GURL(test_page_url);
- request_info.first_party_for_cookies = GURL(test_page_url);
- request_info.referrer = GURL();
- request_info.headers = std::string();
- request_info.load_flags = 0;
- request_info.requestor_pid = 0;
- request_info.request_type = ResourceType::SUB_RESOURCE;
- request_info.appcache_host_id = appcache::kNoHostId;
- request_info.routing_id = 0;
- RequestExtraData extra_data;
- request_info.extra_data = &extra_data;
+ RequestInfo* CreateRequestInfo(RequestExtraData* extra_data) {
+ RequestInfo* request_info = new RequestInfo();
+ request_info->method = "GET";
+ request_info->url = GURL(test_page_url);
+ request_info->first_party_for_cookies = GURL(test_page_url);
+ request_info->referrer = GURL();
+ request_info->headers = std::string();
+ request_info->load_flags = 0;
+ request_info->requestor_pid = 0;
+ request_info->request_type = ResourceType::SUB_RESOURCE;
+ request_info->appcache_host_id = appcache::kNoHostId;
+ request_info->routing_id = 0;
+ request_info->extra_data = extra_data;
- return dispatcher_->CreateBridge(request_info);
+ return 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) {
+ RequestExtraData extra_data;
+ scoped_ptr<RequestInfo> request_info(CreateRequestInfo(&extra_data));
TestRequestCallback callback;
- ResourceLoaderBridge* bridge = CreateBridge();
- bridge->Start(&callback);
+ dispatcher_->StartAsync(*request_info.get(), NULL, &callback);
ProcessMessages();
@@ -203,8 +201,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 +325,13 @@ class DeferredResourceLoadingTest : public ResourceDispatcherTest,
TEST_F(DeferredResourceLoadingTest, DeferredLoadTest) {
base::MessageLoopForIO message_loop;
- ResourceLoaderBridge* bridge = CreateBridge();
-
- bridge->Start(this);
+ RequestExtraData extra_data;
+ scoped_ptr<RequestInfo> request_info(CreateRequestInfo(&extra_data));
+ dispatcher_->StartAsync(*request_info.get(), NULL, this);
InitMessages();
// Dispatch deferred messages.
message_loop.RunUntilIdle();
- delete bridge;
}
class TimeConversionTest : public ResourceDispatcherTest,
@@ -348,8 +343,9 @@ class TimeConversionTest : public ResourceDispatcherTest,
}
void PerformTest(const ResourceResponseHead& response_head) {
- scoped_ptr<ResourceLoaderBridge> bridge(CreateBridge());
- bridge->Start(this);
+ RequestExtraData extra_data;
+ scoped_ptr<RequestInfo> request_info(CreateRequestInfo(&extra_data));
+ dispatcher_->StartAsync(*request_info.get(), NULL, this);
dispatcher_->OnMessageReceived(
ResourceMsg_ReceivedResponse(0, response_head));