diff options
author | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-04 12:24:36 +0000 |
---|---|---|
committer | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-04 12:24:36 +0000 |
commit | 2a1a06d3e83f928a6002de62459085209cd63d3a (patch) | |
tree | c2111b1c92de146425a57b37cfe229c017308282 /content/child/resource_dispatcher_unittest.cc | |
parent | 45b104dce88d1c330af66c6b5910e82770844842 (diff) | |
download | chromium_src-2a1a06d3e83f928a6002de62459085209cd63d3a.zip chromium_src-2a1a06d3e83f928a6002de62459085209cd63d3a.tar.gz chromium_src-2a1a06d3e83f928a6002de62459085209cd63d3a.tar.bz2 |
content: Clean up ResourceDispatcher unit test.
This is another small chunk that can be relanded from r267947.
BUG=265753, 338338, 237249
TEST=content_unittests --gtest_filter=ResourceDispatcherTest.*
R=jam@chromium.org
Review URL: https://codereview.chromium.org/309503012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@274786 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/child/resource_dispatcher_unittest.cc')
-rw-r--r-- | content/child/resource_dispatcher_unittest.cc | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/content/child/resource_dispatcher_unittest.cc b/content/child/resource_dispatcher_unittest.cc index 35c64c8..6f48b70 100644 --- a/content/child/resource_dispatcher_unittest.cc +++ b/content/child/resource_dispatcher_unittest.cc @@ -9,6 +9,7 @@ #include "base/message_loop/message_loop.h" #include "base/process/process.h" #include "base/process/process_handle.h" +#include "base/run_loop.h" #include "content/child/request_extra_data.h" #include "content/child/request_info.h" #include "content/child/resource_dispatcher.h" @@ -189,7 +190,7 @@ 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(); + scoped_ptr<ResourceLoaderBridge> bridge(CreateBridge()); bridge->Start(&callback); @@ -200,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. @@ -323,14 +322,13 @@ class DeferredResourceLoadingTest : public ResourceDispatcherTest, TEST_F(DeferredResourceLoadingTest, DeferredLoadTest) { base::MessageLoopForIO message_loop; - ResourceLoaderBridge* bridge = CreateBridge(); + scoped_ptr<ResourceLoaderBridge> bridge(CreateBridge()); bridge->Start(this); InitMessages(); // Dispatch deferred messages. - message_loop.RunUntilIdle(); - delete bridge; + base::RunLoop().RunUntilIdle(); } class TimeConversionTest : public ResourceDispatcherTest, |