| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "base/files/scoped_temp_dir.h" | 5 #include "base/files/scoped_temp_dir.h" |
| 6 #include "base/stl_util.h" | 6 #include "base/stl_util.h" |
| 7 #include "sync/syncable/deferred_on_disk_directory_backing_store.h" | 7 #include "sync/syncable/deferred_on_disk_directory_backing_store.h" |
| 8 #include "sync/syncable/directory.h" | 8 #include "sync/syncable/directory.h" |
| 9 #include "sync/syncable/entry_kernel.h" | 9 #include "sync/syncable/entry_kernel.h" |
| 10 #include "sync/syncable/on_disk_directory_backing_store.h" | 10 #include "sync/syncable/on_disk_directory_backing_store.h" |
| 11 #include "sync/syncable/syncable_delete_journal.h" | 11 #include "sync/syncable/syncable_delete_journal.h" |
| 12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
| 13 | 13 |
| 14 namespace syncer { | 14 namespace syncer { |
| 15 namespace syncable { | 15 namespace syncable { |
| 16 namespace { | 16 namespace { |
| 17 | 17 |
| 18 static const base::FilePath::CharType kSyncDataFolderName[] = | 18 static const base::FilePath::CharType kSyncDataFolderName[] = |
| 19 FILE_PATH_LITERAL("Sync Data"); | 19 FILE_PATH_LITERAL("Sync Data"); |
| 20 | 20 |
| 21 class DeferredOnDiskDirectoryBackingStoreTest : public testing::Test { | 21 class DeferredOnDiskDirectoryBackingStoreTest : public testing::Test { |
| 22 protected: | 22 protected: |
| 23 virtual void SetUp() OVERRIDE { | 23 virtual void SetUp() override { |
| 24 CHECK(temp_dir_.CreateUniqueTempDir()); | 24 CHECK(temp_dir_.CreateUniqueTempDir()); |
| 25 db_path_ = temp_dir_.path().Append(kSyncDataFolderName); | 25 db_path_ = temp_dir_.path().Append(kSyncDataFolderName); |
| 26 } | 26 } |
| 27 | 27 |
| 28 virtual void TearDown() OVERRIDE { | 28 virtual void TearDown() override { |
| 29 STLDeleteValues(&handles_map_); | 29 STLDeleteValues(&handles_map_); |
| 30 } | 30 } |
| 31 | 31 |
| 32 base::ScopedTempDir temp_dir_; | 32 base::ScopedTempDir temp_dir_; |
| 33 base::FilePath db_path_; | 33 base::FilePath db_path_; |
| 34 Directory::MetahandlesMap handles_map_; | 34 Directory::MetahandlesMap handles_map_; |
| 35 JournalIndex delete_journals_; | 35 JournalIndex delete_journals_; |
| 36 Directory::KernelLoadInfo kernel_load_info_; | 36 Directory::KernelLoadInfo kernel_load_info_; |
| 37 }; | 37 }; |
| 38 | 38 |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 ASSERT_EQ(2u, handles_map_.size()); | 105 ASSERT_EQ(2u, handles_map_.size()); |
| 106 ASSERT_TRUE(handles_map_.count(1)); // root node | 106 ASSERT_TRUE(handles_map_.count(1)); // root node |
| 107 ASSERT_TRUE(handles_map_.count(2)); | 107 ASSERT_TRUE(handles_map_.count(2)); |
| 108 EntryKernel* entry = handles_map_[2]; | 108 EntryKernel* entry = handles_map_[2]; |
| 109 EXPECT_EQ(Id::CreateFromClientString("test_entry"), entry->ref(ID)); | 109 EXPECT_EQ(Id::CreateFromClientString("test_entry"), entry->ref(ID)); |
| 110 } | 110 } |
| 111 | 111 |
| 112 } // namespace | 112 } // namespace |
| 113 } // namespace syncable | 113 } // namespace syncable |
| 114 } // namespace syncer | 114 } // namespace syncer |
| OLD | NEW |