OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/sync_file_system/drive_metadata_store.h" | 5 #include "chrome/browser/sync_file_system/drive_metadata_store.h" |
6 | 6 |
7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
8 #include "base/files/scoped_temp_dir.h" | 8 #include "base/files/scoped_temp_dir.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 | 72 |
73 ASSERT_TRUE(base_dir_.CreateUniqueTempDir()); | 73 ASSERT_TRUE(base_dir_.CreateUniqueTempDir()); |
74 ASSERT_TRUE(fileapi::RegisterSyncableFileSystem(kServiceName)); | 74 ASSERT_TRUE(fileapi::RegisterSyncableFileSystem(kServiceName)); |
75 } | 75 } |
76 | 76 |
77 virtual void TearDown() OVERRIDE { | 77 virtual void TearDown() OVERRIDE { |
78 EXPECT_TRUE(fileapi::RevokeSyncableFileSystem(kServiceName)); | 78 EXPECT_TRUE(fileapi::RevokeSyncableFileSystem(kServiceName)); |
79 | 79 |
80 DropDatabase(); | 80 DropDatabase(); |
81 file_thread_->Stop(); | 81 file_thread_->Stop(); |
82 message_loop_.RunAllPending(); | 82 message_loop_.RunUntilIdle(); |
83 } | 83 } |
84 | 84 |
85 protected: | 85 protected: |
86 void InitializeDatabase() { | 86 void InitializeDatabase() { |
87 EXPECT_TRUE(ui_task_runner_->RunsTasksOnCurrentThread()); | 87 EXPECT_TRUE(ui_task_runner_->RunsTasksOnCurrentThread()); |
88 | 88 |
89 bool done = false; | 89 bool done = false; |
90 SyncStatusCode status = fileapi::SYNC_STATUS_UNKNOWN; | 90 SyncStatusCode status = fileapi::SYNC_STATUS_UNKNOWN; |
91 bool created = false; | 91 bool created = false; |
92 | 92 |
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
397 EXPECT_TRUE(metadata_store()->IsBatchSyncOrigin(kOrigin3)); | 397 EXPECT_TRUE(metadata_store()->IsBatchSyncOrigin(kOrigin3)); |
398 EXPECT_TRUE(metadata_store()->incremental_sync_origins().empty()); | 398 EXPECT_TRUE(metadata_store()->incremental_sync_origins().empty()); |
399 EXPECT_EQ(1u, metadata_map().size()); | 399 EXPECT_EQ(1u, metadata_map().size()); |
400 | 400 |
401 DriveMetadataStore::MetadataMap::const_iterator found = | 401 DriveMetadataStore::MetadataMap::const_iterator found = |
402 metadata_map().find(kOrigin3); | 402 metadata_map().find(kOrigin3); |
403 EXPECT_TRUE(found != metadata_map().end() && found->second.size() == 1u); | 403 EXPECT_TRUE(found != metadata_map().end() && found->second.size() == 1u); |
404 } | 404 } |
405 | 405 |
406 } // namespace sync_file_system | 406 } // namespace sync_file_system |
OLD | NEW |