diff options
author | adamk@chromium.org <adamk@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-14 21:25:01 +0000 |
---|---|---|
committer | adamk@chromium.org <adamk@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-14 21:25:01 +0000 |
commit | b11f26239fb03ebb19bdbb0b60ae68c75eea82d8 (patch) | |
tree | 35b175dde331294401844cdefcda7603335646f7 /webkit/fileapi | |
parent | 3c7b25d3bd9a15c58a4fc19c71c3434f582faa45 (diff) | |
download | chromium_src-b11f26239fb03ebb19bdbb0b60ae68c75eea82d8.zip chromium_src-b11f26239fb03ebb19bdbb0b60ae68c75eea82d8.tar.gz chromium_src-b11f26239fb03ebb19bdbb0b60ae68c75eea82d8.tar.bz2 |
Don't use a separate FILE thread in FileSystemURLRequestJobTest.
Instead, just pass FileUtilProxy a MessageLoopProxy pointing to
the current thread. This gets rid of a memory leak under Valgrind,
and should make the test less flaky in the long run.
BUG=72541
Review URL: http://codereview.chromium.org/6474022
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@74854 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/fileapi')
-rw-r--r-- | webkit/fileapi/file_system_url_request_job_unittest.cc | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/webkit/fileapi/file_system_url_request_job_unittest.cc b/webkit/fileapi/file_system_url_request_job_unittest.cc index c7db1f9..2cdb6d1c 100644 --- a/webkit/fileapi/file_system_url_request_job_unittest.cc +++ b/webkit/fileapi/file_system_url_request_job_unittest.cc @@ -18,11 +18,11 @@ #include "base/file_util.h" #include "base/format_macros.h" #include "base/message_loop.h" +#include "base/message_loop_proxy.h" #include "base/platform_file.h" #include "base/scoped_temp_dir.h" #include "base/string_piece.h" #include "base/stringprintf.h" -#include "base/threading/thread.h" #include "base/utf_string_conversions.h" #include "net/base/load_flags.h" #include "net/base/net_errors.h" @@ -77,11 +77,6 @@ class FileSystemURLRequestJobTest : public testing::Test { &FileSystemURLRequestJobTest::OnGetRootPath)); MessageLoop::current()->RunAllPending(); - file_thread_.reset( - new base::Thread("FileSystemURLRequestJobTest FILE Thread")); - base::Thread::Options options(MessageLoop::TYPE_IO, 0); - file_thread_->StartWithOptions(options); - net::URLRequest::RegisterProtocolFactory("filesystem", &FileSystemURLRequestJobFactory); } @@ -90,8 +85,6 @@ class FileSystemURLRequestJobTest : public testing::Test { // NOTE: order matters, request must die before delegate request_.reset(NULL); delegate_.reset(NULL); - - file_thread_.reset(NULL); net::URLRequest::RegisterProtocolFactory("filesystem", NULL); } @@ -115,7 +108,7 @@ class FileSystemURLRequestJobTest : public testing::Test { if (headers) request_->SetExtraRequestHeaders(*headers); job_ = new FileSystemURLRequestJob(request_.get(), path_manager_.get(), - file_thread_->message_loop_proxy()); + base::MessageLoopProxy::CreateForCurrentThread()); request_->Start(); ASSERT_TRUE(request_->is_pending()); // verify that we're starting async @@ -146,7 +139,6 @@ class FileSystemURLRequestJobTest : public testing::Test { scoped_ptr<net::URLRequest> request_; scoped_ptr<TestDelegate> delegate_; scoped_ptr<FileSystemPathManager> path_manager_; - scoped_ptr<base::Thread> file_thread_; MessageLoop message_loop_; base::ScopedCallbackFactory<FileSystemURLRequestJobTest> callback_factory_; |