diff options
author | adamk@chromium.org <adamk@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-08 21:19:34 +0000 |
---|---|---|
committer | adamk@chromium.org <adamk@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-08 21:19:34 +0000 |
commit | d44992ced69fdd2e88502aea04fd8e312366e268 (patch) | |
tree | 093c0b02ece1c6ad823551bbd79b7e8e023dee6f /webkit/fileapi | |
parent | 46b87bca077624a1aff151b7449505cc2b20ec32 (diff) | |
download | chromium_src-d44992ced69fdd2e88502aea04fd8e312366e268.zip chromium_src-d44992ced69fdd2e88502aea04fd8e312366e268.tar.gz chromium_src-d44992ced69fdd2e88502aea04fd8e312366e268.tar.bz2 |
Make FileSystemDirURLRequestJob test single-threaded in hopes of making it less flaky under Valgrind.
BUG=75251
TEST=none
Review URL: http://codereview.chromium.org/6646001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@77333 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/fileapi')
-rw-r--r-- | webkit/fileapi/file_system_dir_url_request_job_unittest.cc | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/webkit/fileapi/file_system_dir_url_request_job_unittest.cc b/webkit/fileapi/file_system_dir_url_request_job_unittest.cc index 4d81513..eff2b3b 100644 --- a/webkit/fileapi/file_system_dir_url_request_job_unittest.cc +++ b/webkit/fileapi/file_system_dir_url_request_job_unittest.cc @@ -21,7 +21,6 @@ #include "base/platform_file.h" #include "base/scoped_temp_dir.h" #include "base/string_piece.h" -#include "base/threading/thread.h" #include "net/base/net_errors.h" #include "net/base/net_util.h" #include "net/http/http_request_headers.h" @@ -46,11 +45,10 @@ class FileSystemDirURLRequestJobTest : public testing::Test { virtual void SetUp() { ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); - // We use the main thread so that we can get the root path synchronously. - // TODO(adamk): Run this on the FILE thread we've created as well. + file_thread_proxy_ = base::MessageLoopProxy::CreateForCurrentThread(); + path_manager_.reset(new FileSystemPathManager( - base::MessageLoopProxy::CreateForCurrentThread(), - temp_dir_.path(), false, false)); + file_thread_proxy_, temp_dir_.path(), false, false)); path_manager_->GetFileSystemRootPath( GURL("http://remote/"), kFileSystemTypeTemporary, true, // create @@ -58,11 +56,6 @@ class FileSystemDirURLRequestJobTest : public testing::Test { &FileSystemDirURLRequestJobTest::OnGetRootPath)); MessageLoop::current()->RunAllPending(); - file_thread_.reset( - new base::Thread("FileSystemDirURLRequestJobTest FILE Thread")); - base::Thread::Options options(MessageLoop::TYPE_IO, 0); - file_thread_->StartWithOptions(options); - net::URLRequest::RegisterProtocolFactory( "filesystem", &FileSystemDirURLRequestJobFactory); } @@ -72,7 +65,6 @@ class FileSystemDirURLRequestJobTest : public testing::Test { request_.reset(NULL); delegate_.reset(NULL); - file_thread_.reset(NULL); net::URLRequest::RegisterProtocolFactory("filesystem", NULL); } @@ -86,8 +78,9 @@ class FileSystemDirURLRequestJobTest : public testing::Test { delegate_.reset(new TestDelegate()); delegate_->set_quit_on_redirect(true); request_.reset(new net::URLRequest(url, delegate_.get())); - job_ = new FileSystemDirURLRequestJob(request_.get(), path_manager_.get(), - file_thread_->message_loop_proxy()); + job_ = new FileSystemDirURLRequestJob(request_.get(), + path_manager_.get(), + file_thread_proxy_); request_->Start(); ASSERT_TRUE(request_->is_pending()); // verify that we're starting async @@ -117,7 +110,7 @@ class FileSystemDirURLRequestJobTest : public testing::Test { scoped_ptr<net::URLRequest> request_; scoped_ptr<TestDelegate> delegate_; scoped_ptr<FileSystemPathManager> path_manager_; - scoped_ptr<base::Thread> file_thread_; + scoped_refptr<base::MessageLoopProxy> file_thread_proxy_; MessageLoop message_loop_; base::ScopedCallbackFactory<FileSystemDirURLRequestJobTest> callback_factory_; |