| 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 "chrome/browser/sync_file_system/drive_backend/drive_backend_constants.
h" | 7 #include "chrome/browser/sync_file_system/drive_backend/drive_backend_constants.
h" |
| 8 #include "chrome/browser/sync_file_system/drive_backend/drive_backend_test_util.
h" | 8 #include "chrome/browser/sync_file_system/drive_backend/drive_backend_test_util.
h" |
| 9 #include "chrome/browser/sync_file_system/drive_backend/leveldb_wrapper.h" | 9 #include "chrome/browser/sync_file_system/drive_backend/leveldb_wrapper.h" |
| 10 #include "chrome/browser/sync_file_system/drive_backend/metadata_database.h" | 10 #include "chrome/browser/sync_file_system/drive_backend/metadata_database.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 contents->file_metadata.push_back(file_metadata.release()); | 60 contents->file_metadata.push_back(file_metadata.release()); |
| 61 contents->file_trackers.push_back(file_tracker.release()); | 61 contents->file_trackers.push_back(file_tracker.release()); |
| 62 contents->file_trackers.push_back(placeholder_tracker.release()); | 62 contents->file_trackers.push_back(placeholder_tracker.release()); |
| 63 return contents.Pass(); | 63 return contents.Pass(); |
| 64 } | 64 } |
| 65 | 65 |
| 66 } // namespace | 66 } // namespace |
| 67 | 67 |
| 68 class MetadataDatabaseIndexTest : public testing::Test { | 68 class MetadataDatabaseIndexTest : public testing::Test { |
| 69 public: | 69 public: |
| 70 virtual void SetUp() OVERRIDE { | 70 virtual void SetUp() override { |
| 71 in_memory_env_.reset(leveldb::NewMemEnv(leveldb::Env::Default())); | 71 in_memory_env_.reset(leveldb::NewMemEnv(leveldb::Env::Default())); |
| 72 InitializeLevelDB(); | 72 InitializeLevelDB(); |
| 73 | 73 |
| 74 contents_ = CreateTestDatabaseContents(); | 74 contents_ = CreateTestDatabaseContents(); |
| 75 index_ = MetadataDatabaseIndex::CreateForTesting(contents_.get(), | 75 index_ = MetadataDatabaseIndex::CreateForTesting(contents_.get(), |
| 76 db_.get()); | 76 db_.get()); |
| 77 } | 77 } |
| 78 | 78 |
| 79 MetadataDatabaseIndex* index() { return index_.get(); } | 79 MetadataDatabaseIndex* index() { return index_.get(); } |
| 80 | 80 |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 | 157 |
| 158 index()->RemoveFileMetadata("file_id"); | 158 index()->RemoveFileMetadata("file_id"); |
| 159 index()->RemoveFileTracker(kFileTrackerID); | 159 index()->RemoveFileTracker(kFileTrackerID); |
| 160 | 160 |
| 161 EXPECT_FALSE(index()->GetFileMetadata("file_id", nullptr)); | 161 EXPECT_FALSE(index()->GetFileMetadata("file_id", nullptr)); |
| 162 EXPECT_FALSE(index()->GetFileTracker(kFileTrackerID, nullptr)); | 162 EXPECT_FALSE(index()->GetFileTracker(kFileTrackerID, nullptr)); |
| 163 } | 163 } |
| 164 | 164 |
| 165 } // namespace drive_backend | 165 } // namespace drive_backend |
| 166 } // namespace sync_file_system | 166 } // namespace sync_file_system |
| OLD | NEW |