Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(197)

Unified Diff: chrome/browser/sync_file_system/local_file_sync_service_unittest.cc

Issue 17127002: Correctly integrate StoragePartition into TestingProfile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address comments. merge to ToT. Murder a DB thread and more TestBrowserThreads. Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/sync_file_system/local_file_sync_service_unittest.cc
diff --git a/chrome/browser/sync_file_system/local_file_sync_service_unittest.cc b/chrome/browser/sync_file_system/local_file_sync_service_unittest.cc
index 59722dcc81bc03a08b2a6d0247453483f894aed1..35cc430b82002205234dd12507b1b045f64fe49e 100644
--- a/chrome/browser/sync_file_system/local_file_sync_service_unittest.cc
+++ b/chrome/browser/sync_file_system/local_file_sync_service_unittest.cc
@@ -14,6 +14,8 @@
#include "chrome/browser/sync_file_system/mock_local_change_processor.h"
#include "chrome/browser/sync_file_system/sync_file_system_test_util.h"
#include "chrome/test/base/testing_profile.h"
+#include "content/public/browser/browser_thread.h"
+#include "content/public/test/test_browser_thread_bundle.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "webkit/browser/fileapi/file_system_context.h"
@@ -27,6 +29,7 @@
#include "webkit/browser/fileapi/syncable/sync_status_code.h"
#include "webkit/browser/fileapi/syncable/syncable_file_system_util.h"
+using content::BrowserThread;
using fileapi::FileSystemURL;
using ::testing::_;
using ::testing::AtLeast;
@@ -102,12 +105,10 @@ class LocalFileSyncServiceTest
virtual void SetUp() OVERRIDE {
ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
- thread_helper_.SetUp();
-
file_system_.reset(new CannedSyncableFileSystem(
GURL(kOrigin),
- thread_helper_.io_task_runner(),
- thread_helper_.file_task_runner()));
+ BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO),
+ BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE)));
local_service_.reset(new LocalFileSyncService(&profile_));
@@ -132,8 +133,6 @@ class LocalFileSyncServiceTest
local_service_->Shutdown();
file_system_->TearDown();
RevokeSyncableFileSystem();
-
- thread_helper_.TearDown();
}
// LocalChangeObserver overrides.
@@ -173,11 +172,11 @@ class LocalFileSyncServiceTest
return file_system_->file_system_context()->change_tracker()->num_changes();
}
+ content::TestBrowserThreadBundle thread_bundle_;
kinuko 2013/07/12 04:35:44 MultiThreadTestHelper internally uses TestBrowserT
awong 2013/07/12 07:17:39 Nope...it's not required. I thought it was just ex
kinuko 2013/07/12 07:28:27 Right, in most cases I'd agree with you and just u
+
ScopedEnableSyncFSDirectoryOperation enable_directory_operation_;
TestingProfile profile_;
- MultiThreadTestHelper thread_helper_;
-
base::ScopedTempDir temp_dir_;
scoped_ptr<CannedSyncableFileSystem> file_system_;
@@ -277,9 +276,10 @@ TEST_F(LocalFileSyncServiceTest, LocalChangeObserver) {
TEST_F(LocalFileSyncServiceTest, MAYBE_LocalChangeObserverMultipleContexts) {
const char kOrigin2[] = "http://foo";
- CannedSyncableFileSystem file_system2(GURL(kOrigin2),
- thread_helper_.io_task_runner(),
- thread_helper_.file_task_runner());
+ CannedSyncableFileSystem file_system2(
+ GURL(kOrigin2),
+ BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO),
+ BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE));
file_system2.SetUp();
base::RunLoop run_loop;

Powered by Google App Engine
This is Rietveld 408576698