From b11f26239fb03ebb19bdbb0b60ae68c75eea82d8 Mon Sep 17 00:00:00 2001 From: "adamk@chromium.org" Date: Mon, 14 Feb 2011 21:25:01 +0000 Subject: 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 --- webkit/fileapi/file_system_url_request_job_unittest.cc | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'webkit/fileapi') 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 request_; scoped_ptr delegate_; scoped_ptr path_manager_; - scoped_ptr file_thread_; MessageLoop message_loop_; base::ScopedCallbackFactory callback_factory_; -- cgit v1.1