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 "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 Loading... |
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 Loading... |
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 |
OLD | NEW |