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 "chrome/browser/sync_file_system/drive_backend/metadata_database_index.
h" | 5 #include "chrome/browser/sync_file_system/drive_backend/metadata_database_index.
h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 | 47 |
48 std::unique_ptr<FileMetadata> file_metadata = | 48 std::unique_ptr<FileMetadata> file_metadata = |
49 test_util::CreateFileMetadata("file_id", "file", "file_md5"); | 49 test_util::CreateFileMetadata("file_id", "file", "file_md5"); |
50 std::unique_ptr<FileTracker> file_tracker = test_util::CreateTracker( | 50 std::unique_ptr<FileTracker> file_tracker = test_util::CreateTracker( |
51 *file_metadata, kFileTrackerID, app_root_tracker.get()); | 51 *file_metadata, kFileTrackerID, app_root_tracker.get()); |
52 | 52 |
53 std::unique_ptr<FileTracker> placeholder_tracker = | 53 std::unique_ptr<FileTracker> placeholder_tracker = |
54 test_util::CreatePlaceholderTracker( | 54 test_util::CreatePlaceholderTracker( |
55 "unsynced_file_id", kPlaceholderTrackerID, app_root_tracker.get()); | 55 "unsynced_file_id", kPlaceholderTrackerID, app_root_tracker.get()); |
56 | 56 |
57 contents->file_metadata.push_back(sync_root_metadata.release()); | 57 contents->file_metadata.push_back(std::move(sync_root_metadata)); |
58 contents->file_trackers.push_back(sync_root_tracker.release()); | 58 contents->file_trackers.push_back(std::move(sync_root_tracker)); |
59 contents->file_metadata.push_back(app_root_metadata.release()); | 59 contents->file_metadata.push_back(std::move(app_root_metadata)); |
60 contents->file_trackers.push_back(app_root_tracker.release()); | 60 contents->file_trackers.push_back(std::move(app_root_tracker)); |
61 contents->file_metadata.push_back(file_metadata.release()); | 61 contents->file_metadata.push_back(std::move(file_metadata)); |
62 contents->file_trackers.push_back(file_tracker.release()); | 62 contents->file_trackers.push_back(std::move(file_tracker)); |
63 contents->file_trackers.push_back(placeholder_tracker.release()); | 63 contents->file_trackers.push_back(std::move(placeholder_tracker)); |
64 return contents; | 64 return contents; |
65 } | 65 } |
66 | 66 |
67 } // namespace | 67 } // namespace |
68 | 68 |
69 class MetadataDatabaseIndexTest : public testing::Test { | 69 class MetadataDatabaseIndexTest : public testing::Test { |
70 public: | 70 public: |
71 void SetUp() override { | 71 void SetUp() override { |
72 in_memory_env_.reset(leveldb::NewMemEnv(leveldb::Env::Default())); | 72 in_memory_env_.reset(leveldb::NewMemEnv(leveldb::Env::Default())); |
73 InitializeLevelDB(); | 73 InitializeLevelDB(); |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 | 158 |
159 index()->RemoveFileMetadata("file_id"); | 159 index()->RemoveFileMetadata("file_id"); |
160 index()->RemoveFileTracker(kFileTrackerID); | 160 index()->RemoveFileTracker(kFileTrackerID); |
161 | 161 |
162 EXPECT_FALSE(index()->GetFileMetadata("file_id", nullptr)); | 162 EXPECT_FALSE(index()->GetFileMetadata("file_id", nullptr)); |
163 EXPECT_FALSE(index()->GetFileTracker(kFileTrackerID, nullptr)); | 163 EXPECT_FALSE(index()->GetFileTracker(kFileTrackerID, nullptr)); |
164 } | 164 } |
165 | 165 |
166 } // namespace drive_backend | 166 } // namespace drive_backend |
167 } // namespace sync_file_system | 167 } // namespace sync_file_system |
OLD | NEW |