Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(146)

Side by Side Diff: webkit/fileapi/file_system_usage_cache_unittest.cc

Issue 11359217: Move scoped_temp_dir from base to base/files (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "webkit/fileapi/file_system_usage_cache.h" 5 #include "webkit/fileapi/file_system_usage_cache.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/scoped_temp_dir.h" 9 #include "base/files/scoped_temp_dir.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
11 11
12 namespace fileapi { 12 namespace fileapi {
13 13
14 class FileSystemUsageCacheTest : public testing::Test { 14 class FileSystemUsageCacheTest : public testing::Test {
15 public: 15 public:
16 FileSystemUsageCacheTest() {} 16 FileSystemUsageCacheTest() {}
17 17
18 void SetUp() { 18 void SetUp() {
19 ASSERT_TRUE(data_dir_.CreateUniqueTempDir()); 19 ASSERT_TRUE(data_dir_.CreateUniqueTempDir());
20 } 20 }
21 21
22 protected: 22 protected:
23 FilePath GetUsageFilePath() { 23 FilePath GetUsageFilePath() {
24 return data_dir_.path().Append(FileSystemUsageCache::kUsageFileName); 24 return data_dir_.path().Append(FileSystemUsageCache::kUsageFileName);
25 } 25 }
26 26
27 private: 27 private:
28 ScopedTempDir data_dir_; 28 base::ScopedTempDir data_dir_;
29 29
30 DISALLOW_COPY_AND_ASSIGN(FileSystemUsageCacheTest); 30 DISALLOW_COPY_AND_ASSIGN(FileSystemUsageCacheTest);
31 }; 31 };
32 32
33 TEST_F(FileSystemUsageCacheTest, CreateTest) { 33 TEST_F(FileSystemUsageCacheTest, CreateTest) {
34 FilePath usage_file_path = GetUsageFilePath(); 34 FilePath usage_file_path = GetUsageFilePath();
35 EXPECT_EQ(FileSystemUsageCache::kUsageFileSize, 35 EXPECT_EQ(FileSystemUsageCache::kUsageFileSize,
36 FileSystemUsageCache::UpdateUsage(usage_file_path, 0)); 36 FileSystemUsageCache::UpdateUsage(usage_file_path, 0));
37 } 37 }
38 38
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 FilePath usage_file_path = GetUsageFilePath(); 127 FilePath usage_file_path = GetUsageFilePath();
128 EXPECT_FALSE(FileSystemUsageCache::IncrementDirty(usage_file_path)); 128 EXPECT_FALSE(FileSystemUsageCache::IncrementDirty(usage_file_path));
129 } 129 }
130 130
131 TEST_F(FileSystemUsageCacheTest, DecrementDirtyWithoutCacheFileTest) { 131 TEST_F(FileSystemUsageCacheTest, DecrementDirtyWithoutCacheFileTest) {
132 FilePath usage_file_path = GetUsageFilePath(); 132 FilePath usage_file_path = GetUsageFilePath();
133 EXPECT_FALSE(FileSystemUsageCache::IncrementDirty(usage_file_path)); 133 EXPECT_FALSE(FileSystemUsageCache::IncrementDirty(usage_file_path));
134 } 134 }
135 135
136 } // namespace fileapi 136 } // namespace fileapi
OLDNEW
« no previous file with comments | « webkit/fileapi/file_system_url_request_job_unittest.cc ('k') | webkit/fileapi/file_writer_delegate_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698