| 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/chromeos/drive/drive_cache_metadata.h" | 5 #include "chrome/browser/chromeos/drive/drive_cache_metadata.h" |
| 6 | 6 |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/scoped_temp_dir.h" | 8 #include "base/scoped_temp_dir.h" |
| 9 #include "chrome/browser/chromeos/drive/drive.pb.h" | 9 #include "chrome/browser/chromeos/drive/drive.pb.h" |
| 10 #include "chrome/browser/chromeos/drive/drive_file_system_util.h" | 10 #include "chrome/browser/chromeos/drive/drive_file_system_util.h" |
| 11 #include "chrome/browser/chromeos/drive/drive_test_util.h" | 11 #include "chrome/browser/chromeos/drive/drive_test_util.h" |
| 12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
| 13 | 13 |
| 14 namespace gdata { | 14 namespace drive { |
| 15 | 15 |
| 16 class DriveCacheMetadataTest : public testing::Test { | 16 class DriveCacheMetadataTest : public testing::Test { |
| 17 public: | 17 public: |
| 18 DriveCacheMetadataTest() {} | 18 DriveCacheMetadataTest() {} |
| 19 | 19 |
| 20 virtual void SetUp() OVERRIDE { | 20 virtual void SetUp() OVERRIDE { |
| 21 // Create cache directories. | 21 // Create cache directories. |
| 22 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); | 22 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
| 23 cache_paths_ = DriveCache::GetCachePaths(temp_dir_.path()); | 23 cache_paths_ = DriveCache::GetCachePaths(temp_dir_.path()); |
| 24 ASSERT_TRUE(DriveCache::CreateCacheDirectories(cache_paths_)); | 24 ASSERT_TRUE(DriveCache::CreateCacheDirectories(cache_paths_)); |
| (...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 // failure of opening the DB. | 414 // failure of opening the DB. |
| 415 std::vector<FilePath> cache_paths = | 415 std::vector<FilePath> cache_paths = |
| 416 DriveCache::GetCachePaths( | 416 DriveCache::GetCachePaths( |
| 417 FilePath::FromUTF8Unsafe("/somewhere/nonexistent")); | 417 FilePath::FromUTF8Unsafe("/somewhere/nonexistent")); |
| 418 | 418 |
| 419 scoped_ptr<DriveCacheMetadata> metadata = | 419 scoped_ptr<DriveCacheMetadata> metadata = |
| 420 DriveCacheMetadata::CreateDriveCacheMetadata(NULL).Pass(); | 420 DriveCacheMetadata::CreateDriveCacheMetadata(NULL).Pass(); |
| 421 EXPECT_FALSE(metadata->Initialize(cache_paths)); | 421 EXPECT_FALSE(metadata->Initialize(cache_paths)); |
| 422 } | 422 } |
| 423 | 423 |
| 424 } // namespace gdata | 424 } // namespace drive |
| OLD | NEW |