OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/file_util.h" |
| 6 #include "base/scoped_temp_dir.h" |
5 #include "net/disk_cache/cache_util.h" | 7 #include "net/disk_cache/cache_util.h" |
6 #include "base/file_util.h" | |
7 #include "base/memory/scoped_temp_dir.h" | |
8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
9 #include "testing/platform_test.h" | 9 #include "testing/platform_test.h" |
10 | 10 |
11 namespace disk_cache { | 11 namespace disk_cache { |
12 | 12 |
13 class CacheUtilTest : public PlatformTest { | 13 class CacheUtilTest : public PlatformTest { |
14 public: | 14 public: |
15 void SetUp() { | 15 void SetUp() { |
16 PlatformTest::SetUp(); | 16 PlatformTest::SetUp(); |
17 ASSERT_TRUE(tmp_dir_.CreateUniqueTempDir()); | 17 ASSERT_TRUE(tmp_dir_.CreateUniqueTempDir()); |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 EXPECT_FALSE(file_util::PathExists(file2_)); | 81 EXPECT_FALSE(file_util::PathExists(file2_)); |
82 } | 82 } |
83 | 83 |
84 TEST_F(CacheUtilTest, DeleteCacheFile) { | 84 TEST_F(CacheUtilTest, DeleteCacheFile) { |
85 EXPECT_TRUE(disk_cache::DeleteCacheFile(file1_)); | 85 EXPECT_TRUE(disk_cache::DeleteCacheFile(file1_)); |
86 EXPECT_FALSE(file_util::PathExists(file1_)); | 86 EXPECT_FALSE(file_util::PathExists(file1_)); |
87 EXPECT_TRUE(file_util::PathExists(cache_dir_)); // cache dir stays | 87 EXPECT_TRUE(file_util::PathExists(cache_dir_)); // cache dir stays |
88 } | 88 } |
89 | 89 |
90 } // namespace disk_cache | 90 } // namespace disk_cache |
OLD | NEW |