| OLD | NEW |
| 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 <vector> | 5 #include <vector> |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 | 115 |
| 116 file_system_.reset(new CannedSyncableFileSystem( | 116 file_system_.reset(new CannedSyncableFileSystem( |
| 117 GURL(kOrigin), | 117 GURL(kOrigin), |
| 118 in_memory_env_.get(), | 118 in_memory_env_.get(), |
| 119 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO), | 119 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO), |
| 120 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE))); | 120 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE))); |
| 121 | 121 |
| 122 local_service_ = LocalFileSyncService::CreateForTesting( | 122 local_service_ = LocalFileSyncService::CreateForTesting( |
| 123 &profile_, in_memory_env_.get()); | 123 &profile_, in_memory_env_.get()); |
| 124 | 124 |
| 125 file_system_->SetUp(); | 125 file_system_->SetUp(CannedSyncableFileSystem::QUOTA_ENABLED); |
| 126 | 126 |
| 127 base::RunLoop run_loop; | 127 base::RunLoop run_loop; |
| 128 SyncStatusCode status = SYNC_STATUS_UNKNOWN; | 128 SyncStatusCode status = SYNC_STATUS_UNKNOWN; |
| 129 local_service_->MaybeInitializeFileSystemContext( | 129 local_service_->MaybeInitializeFileSystemContext( |
| 130 GURL(kOrigin), file_system_->file_system_context(), | 130 GURL(kOrigin), file_system_->file_system_context(), |
| 131 AssignAndQuitCallback(&run_loop, &status)); | 131 AssignAndQuitCallback(&run_loop, &status)); |
| 132 run_loop.Run(); | 132 run_loop.Run(); |
| 133 | 133 |
| 134 local_service_->AddChangeObserver(this); | 134 local_service_->AddChangeObserver(this); |
| 135 | 135 |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 LocalChangeObserverMultipleContexts | 295 LocalChangeObserverMultipleContexts |
| 296 #endif | 296 #endif |
| 297 | 297 |
| 298 TEST_F(LocalFileSyncServiceTest, MAYBE_LocalChangeObserverMultipleContexts) { | 298 TEST_F(LocalFileSyncServiceTest, MAYBE_LocalChangeObserverMultipleContexts) { |
| 299 const char kOrigin2[] = "http://foo"; | 299 const char kOrigin2[] = "http://foo"; |
| 300 CannedSyncableFileSystem file_system2( | 300 CannedSyncableFileSystem file_system2( |
| 301 GURL(kOrigin2), | 301 GURL(kOrigin2), |
| 302 in_memory_env_.get(), | 302 in_memory_env_.get(), |
| 303 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO), | 303 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO), |
| 304 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE)); | 304 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE)); |
| 305 file_system2.SetUp(); | 305 file_system2.SetUp(CannedSyncableFileSystem::QUOTA_ENABLED); |
| 306 | 306 |
| 307 base::RunLoop run_loop; | 307 base::RunLoop run_loop; |
| 308 SyncStatusCode status = SYNC_STATUS_UNKNOWN; | 308 SyncStatusCode status = SYNC_STATUS_UNKNOWN; |
| 309 local_service_->MaybeInitializeFileSystemContext( | 309 local_service_->MaybeInitializeFileSystemContext( |
| 310 GURL(kOrigin2), file_system2.file_system_context(), | 310 GURL(kOrigin2), file_system2.file_system_context(), |
| 311 AssignAndQuitCallback(&run_loop, &status)); | 311 AssignAndQuitCallback(&run_loop, &status)); |
| 312 run_loop.Run(); | 312 run_loop.Run(); |
| 313 | 313 |
| 314 EXPECT_EQ(base::File::FILE_OK, file_system2.OpenFileSystem()); | 314 EXPECT_EQ(base::File::FILE_OK, file_system2.OpenFileSystem()); |
| 315 file_system2.backend()->sync_context()-> | 315 file_system2.backend()->sync_context()-> |
| (...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 727 all_origins.insert(kOrigin2); | 727 all_origins.insert(kOrigin2); |
| 728 all_origins.insert(kOrigin3); | 728 all_origins.insert(kOrigin3); |
| 729 while (!all_origins.empty()) { | 729 while (!all_origins.empty()) { |
| 730 ASSERT_TRUE(NextOriginToProcess(&origin)); | 730 ASSERT_TRUE(NextOriginToProcess(&origin)); |
| 731 ASSERT_TRUE(ContainsKey(all_origins, origin)); | 731 ASSERT_TRUE(ContainsKey(all_origins, origin)); |
| 732 all_origins.erase(origin); | 732 all_origins.erase(origin); |
| 733 } | 733 } |
| 734 } | 734 } |
| 735 | 735 |
| 736 } // namespace sync_file_system | 736 } // namespace sync_file_system |
| OLD | NEW |