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

Side by Side Diff: webkit/browser/fileapi/test_file_set.cc

Issue 100573002: Move directory creation functions to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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/browser/fileapi/test_file_set.h" 5 #include "webkit/browser/fileapi/test_file_set.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 25 matching lines...) Expand all
36 {false, FILE_PATH_LITERAL("dir a/dir d/dir e/dir g/file 2"), 42}, 36 {false, FILE_PATH_LITERAL("dir a/dir d/dir e/dir g/file 2"), 42},
37 {false, FILE_PATH_LITERAL("dir a/dir d/dir e/dir g/file 3"), 50}, 37 {false, FILE_PATH_LITERAL("dir a/dir d/dir e/dir g/file 3"), 50},
38 }; 38 };
39 39
40 const size_t kRegularTestCaseSize = arraysize(kRegularTestCases); 40 const size_t kRegularTestCaseSize = arraysize(kRegularTestCases);
41 41
42 void SetUpOneTestCase(const base::FilePath& root_path, 42 void SetUpOneTestCase(const base::FilePath& root_path,
43 const TestCaseRecord& test_case) { 43 const TestCaseRecord& test_case) {
44 base::FilePath path = root_path.Append(test_case.path); 44 base::FilePath path = root_path.Append(test_case.path);
45 if (test_case.is_directory) { 45 if (test_case.is_directory) {
46 ASSERT_TRUE(file_util::CreateDirectory(path)); 46 ASSERT_TRUE(base::CreateDirectory(path));
47 return; 47 return;
48 } 48 }
49 base::PlatformFileError error_code; 49 base::PlatformFileError error_code;
50 bool created = false; 50 bool created = false;
51 int file_flags = base::PLATFORM_FILE_CREATE_ALWAYS | 51 int file_flags = base::PLATFORM_FILE_CREATE_ALWAYS |
52 base::PLATFORM_FILE_WRITE; 52 base::PLATFORM_FILE_WRITE;
53 base::PlatformFile file_handle = 53 base::PlatformFile file_handle =
54 base::CreatePlatformFile(path, file_flags, &created, &error_code); 54 base::CreatePlatformFile(path, file_flags, &created, &error_code);
55 EXPECT_TRUE(created); 55 EXPECT_TRUE(created);
56 ASSERT_EQ(base::PLATFORM_FILE_OK, error_code); 56 ASSERT_EQ(base::PLATFORM_FILE_OK, error_code);
(...skipping 10 matching lines...) Expand all
67 void SetUpRegularTestCases(const base::FilePath& root_path) { 67 void SetUpRegularTestCases(const base::FilePath& root_path) {
68 for (size_t i = 0; i < arraysize(kRegularTestCases); ++i) { 68 for (size_t i = 0; i < arraysize(kRegularTestCases); ++i) {
69 SCOPED_TRACE(testing::Message() << "Creating kRegularTestCases " << i); 69 SCOPED_TRACE(testing::Message() << "Creating kRegularTestCases " << i);
70 SetUpOneTestCase(root_path, kRegularTestCases[i]); 70 SetUpOneTestCase(root_path, kRegularTestCases[i]);
71 } 71 }
72 } 72 }
73 73
74 } // namespace test 74 } // namespace test
75 75
76 } // namespace fileapi 76 } // namespace fileapi
OLDNEW
« no previous file with comments | « webkit/browser/fileapi/sandbox_prioritized_origin_database_unittest.cc ('k') | webkit/browser/quota/quota_database.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698