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

Side by Side Diff: chrome/browser/sync_file_system/local/local_file_sync_service_unittest.cc

Issue 2133083002: Remove all remaining traces of MessageLoopProxy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <stdint.h> 5 #include <stdint.h>
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/files/file_util.h" 10 #include "base/files/file_util.h"
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 LocalFileSyncServiceTest() 110 LocalFileSyncServiceTest()
111 : thread_bundle_(content::TestBrowserThreadBundle::REAL_FILE_THREAD | 111 : thread_bundle_(content::TestBrowserThreadBundle::REAL_FILE_THREAD |
112 content::TestBrowserThreadBundle::REAL_IO_THREAD), 112 content::TestBrowserThreadBundle::REAL_IO_THREAD),
113 num_changes_(0) {} 113 num_changes_(0) {}
114 114
115 void SetUp() override { 115 void SetUp() override {
116 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); 116 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
117 in_memory_env_.reset(leveldb::NewMemEnv(leveldb::Env::Default())); 117 in_memory_env_.reset(leveldb::NewMemEnv(leveldb::Env::Default()));
118 118
119 file_system_.reset(new CannedSyncableFileSystem( 119 file_system_.reset(new CannedSyncableFileSystem(
120 GURL(kOrigin), 120 GURL(kOrigin), in_memory_env_.get(),
121 in_memory_env_.get(), 121 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO),
122 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO), 122 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE)));
123 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE)));
124 123
125 local_service_ = LocalFileSyncService::CreateForTesting( 124 local_service_ = LocalFileSyncService::CreateForTesting(
126 &profile_, in_memory_env_.get()); 125 &profile_, in_memory_env_.get());
127 126
128 file_system_->SetUp(CannedSyncableFileSystem::QUOTA_ENABLED); 127 file_system_->SetUp(CannedSyncableFileSystem::QUOTA_ENABLED);
129 128
130 base::RunLoop run_loop; 129 base::RunLoop run_loop;
131 SyncStatusCode status = SYNC_STATUS_UNKNOWN; 130 SyncStatusCode status = SYNC_STATUS_UNKNOWN;
132 local_service_->MaybeInitializeFileSystemContext( 131 local_service_->MaybeInitializeFileSystemContext(
133 GURL(kOrigin), file_system_->file_system_context(), 132 GURL(kOrigin), file_system_->file_system_context(),
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 #define MAYBE_LocalChangeObserverMultipleContexts\ 292 #define MAYBE_LocalChangeObserverMultipleContexts\
294 DISABLED_LocalChangeObserverMultipleContexts 293 DISABLED_LocalChangeObserverMultipleContexts
295 #else 294 #else
296 #define MAYBE_LocalChangeObserverMultipleContexts\ 295 #define MAYBE_LocalChangeObserverMultipleContexts\
297 LocalChangeObserverMultipleContexts 296 LocalChangeObserverMultipleContexts
298 #endif 297 #endif
299 298
300 TEST_F(LocalFileSyncServiceTest, MAYBE_LocalChangeObserverMultipleContexts) { 299 TEST_F(LocalFileSyncServiceTest, MAYBE_LocalChangeObserverMultipleContexts) {
301 const char kOrigin2[] = "http://foo"; 300 const char kOrigin2[] = "http://foo";
302 CannedSyncableFileSystem file_system2( 301 CannedSyncableFileSystem file_system2(
303 GURL(kOrigin2), 302 GURL(kOrigin2), in_memory_env_.get(),
304 in_memory_env_.get(), 303 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO),
305 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO), 304 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE));
306 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE));
307 file_system2.SetUp(CannedSyncableFileSystem::QUOTA_ENABLED); 305 file_system2.SetUp(CannedSyncableFileSystem::QUOTA_ENABLED);
308 306
309 base::RunLoop run_loop; 307 base::RunLoop run_loop;
310 SyncStatusCode status = SYNC_STATUS_UNKNOWN; 308 SyncStatusCode status = SYNC_STATUS_UNKNOWN;
311 local_service_->MaybeInitializeFileSystemContext( 309 local_service_->MaybeInitializeFileSystemContext(
312 GURL(kOrigin2), file_system2.file_system_context(), 310 GURL(kOrigin2), file_system2.file_system_context(),
313 AssignAndQuitCallback(&run_loop, &status)); 311 AssignAndQuitCallback(&run_loop, &status));
314 run_loop.Run(); 312 run_loop.Run();
315 313
316 EXPECT_EQ(base::File::FILE_OK, file_system2.OpenFileSystem()); 314 EXPECT_EQ(base::File::FILE_OK, file_system2.OpenFileSystem());
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after
727 all_origins.insert(kOrigin2); 725 all_origins.insert(kOrigin2);
728 all_origins.insert(kOrigin3); 726 all_origins.insert(kOrigin3);
729 while (!all_origins.empty()) { 727 while (!all_origins.empty()) {
730 ASSERT_TRUE(NextOriginToProcess(&origin)); 728 ASSERT_TRUE(NextOriginToProcess(&origin));
731 ASSERT_TRUE(ContainsKey(all_origins, origin)); 729 ASSERT_TRUE(ContainsKey(all_origins, origin));
732 all_origins.erase(origin); 730 all_origins.erase(origin);
733 } 731 }
734 } 732 }
735 733
736 } // namespace sync_file_system 734 } // namespace sync_file_system
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698