| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/test/sync/engine/test_directory_setter_upper.h" | 5 #include "chrome/test/sync/engine/test_directory_setter_upper.h" |
| 6 | 6 |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "chrome/browser/sync/syncable/directory_manager.h" | 9 #include "chrome/browser/sync/syncable/directory_manager.h" |
| 10 #include "chrome/browser/sync/syncable/syncable.h" | 10 #include "chrome/browser/sync/syncable/syncable.h" |
| 11 #include "chrome/browser/sync/util/event_sys-inl.h" | 11 #include "chrome/browser/sync/util/event_sys-inl.h" |
| 12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
| 13 | 13 |
| 14 using syncable::DirectoryManager; | 14 using syncable::DirectoryManager; |
| 15 using syncable::ReadTransaction; | 15 using syncable::ReadTransaction; |
| 16 using syncable::ScopedDirLookup; | 16 using syncable::ScopedDirLookup; |
| 17 | 17 |
| 18 namespace browser_sync { | 18 namespace browser_sync { |
| 19 | 19 |
| 20 TestDirectorySetterUpper::TestDirectorySetterUpper() : name_(PSTR("Test")) {} | 20 TestDirectorySetterUpper::TestDirectorySetterUpper() : name_("Test") {} |
| 21 TestDirectorySetterUpper::TestDirectorySetterUpper(const std::string& name) | 21 TestDirectorySetterUpper::TestDirectorySetterUpper(const std::string& name) |
| 22 : name_(name) {} | 22 : name_(name) {} |
| 23 | 23 |
| 24 TestDirectorySetterUpper::~TestDirectorySetterUpper() {} | 24 TestDirectorySetterUpper::~TestDirectorySetterUpper() {} |
| 25 | 25 |
| 26 void TestDirectorySetterUpper::Init() { | 26 void TestDirectorySetterUpper::Init() { |
| 27 FilePath test_data_dir_(FILE_PATH_LITERAL(".")); | 27 FilePath test_data_dir_(FILE_PATH_LITERAL(".")); |
| 28 manager_.reset(new DirectoryManager(test_data_dir_)); | 28 manager_.reset(new DirectoryManager(test_data_dir_)); |
| 29 file_path_ = manager_->GetSyncDataDatabasePath(); | 29 file_path_ = manager_->GetSyncDataDatabasePath(); |
| 30 file_util::Delete(file_path_, false); | 30 file_util::Delete(file_path_, false); |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 DirectoryManager::DirNames names; | 98 DirectoryManager::DirNames names; |
| 99 manager()->GetOpenDirectories(&names); | 99 manager()->GetOpenDirectories(&names); |
| 100 if (!names.empty()) { | 100 if (!names.empty()) { |
| 101 ASSERT_EQ(1U, names.size()); | 101 ASSERT_EQ(1U, names.size()); |
| 102 ASSERT_EQ(name(), names[0]); | 102 ASSERT_EQ(name(), names[0]); |
| 103 TestDirectorySetterUpper::TearDown(); | 103 TestDirectorySetterUpper::TearDown(); |
| 104 } | 104 } |
| 105 } | 105 } |
| 106 | 106 |
| 107 } // namespace browser_sync | 107 } // namespace browser_sync |
| OLD | NEW |