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/message_loop.h" | 9 #include "base/message_loop.h" |
9 #include "base/scoped_temp_dir.h" | |
10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
11 #include "base/stl_util.h" | 11 #include "base/stl_util.h" |
12 #include "base/threading/thread.h" | 12 #include "base/threading/thread.h" |
13 #include "chrome/browser/sync_file_system/drive_file_sync_service.h" | 13 #include "chrome/browser/sync_file_system/drive_file_sync_service.h" |
14 #include "chrome/browser/sync_file_system/sync_file_system.pb.h" | 14 #include "chrome/browser/sync_file_system/sync_file_system.pb.h" |
15 #include "content/public/browser/browser_thread.h" | 15 #include "content/public/browser/browser_thread.h" |
16 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
17 #include "webkit/fileapi/isolated_context.h" | 17 #include "webkit/fileapi/isolated_context.h" |
18 #include "webkit/fileapi/syncable/syncable_file_system_util.h" | 18 #include "webkit/fileapi/syncable/syncable_file_system_util.h" |
19 | 19 |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 void DidRestoreSyncRootDirectory(SyncStatusCode status) { | 177 void DidRestoreSyncRootDirectory(SyncStatusCode status) { |
178 EXPECT_EQ(fileapi::SYNC_STATUS_OK, status); | 178 EXPECT_EQ(fileapi::SYNC_STATUS_OK, status); |
179 message_loop_.Quit(); | 179 message_loop_.Quit(); |
180 } | 180 } |
181 | 181 |
182 void DidRestoreSyncOrigins(SyncStatusCode status) { | 182 void DidRestoreSyncOrigins(SyncStatusCode status) { |
183 EXPECT_EQ(fileapi::SYNC_STATUS_OK, status); | 183 EXPECT_EQ(fileapi::SYNC_STATUS_OK, status); |
184 message_loop_.Quit(); | 184 message_loop_.Quit(); |
185 } | 185 } |
186 | 186 |
187 ScopedTempDir base_dir_; | 187 base::ScopedTempDir base_dir_; |
188 | 188 |
189 MessageLoop message_loop_; | 189 MessageLoop message_loop_; |
190 scoped_ptr<base::Thread> file_thread_; | 190 scoped_ptr<base::Thread> file_thread_; |
191 | 191 |
192 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_; | 192 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_; |
193 scoped_refptr<base::SequencedTaskRunner> file_task_runner_; | 193 scoped_refptr<base::SequencedTaskRunner> file_task_runner_; |
194 | 194 |
195 scoped_ptr<DriveMetadataStore> drive_metadata_store_; | 195 scoped_ptr<DriveMetadataStore> drive_metadata_store_; |
196 | 196 |
197 bool created_; | 197 bool created_; |
(...skipping 199 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 |