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

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

Issue 12286020: Replace FilePath with base::FilePath. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 months 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
« no previous file with comments | « webkit/fileapi/file_system_util.cc ('k') | webkit/fileapi/isolated_file_util_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_util.h" 5 #include "webkit/fileapi/file_system_util.h"
6 6
7 #include "base/file_path.h" 7 #include "base/file_path.h"
8 #include "googleurl/src/gurl.h" 8 #include "googleurl/src/gurl.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 #include "webkit/fileapi/file_system_types.h" 10 #include "webkit/fileapi/file_system_types.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 }; 49 };
50 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_cases); ++i) { 50 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_cases); ++i) {
51 base::FilePath input = base::FilePath(test_cases[i].path); 51 base::FilePath input = base::FilePath(test_cases[i].path);
52 base::FilePath base_name = VirtualPath::BaseName(input); 52 base::FilePath base_name = VirtualPath::BaseName(input);
53 EXPECT_EQ(test_cases[i].base_name, base_name.value()); 53 EXPECT_EQ(test_cases[i].base_name, base_name.value());
54 } 54 }
55 } 55 }
56 56
57 TEST_F(FileSystemUtilTest, GetNormalizedFilePath) { 57 TEST_F(FileSystemUtilTest, GetNormalizedFilePath) {
58 struct test_data { 58 struct test_data {
59 const FilePath::StringType path; 59 const base::FilePath::StringType path;
60 const FilePath::StringType normalized_path; 60 const base::FilePath::StringType normalized_path;
61 } test_cases[] = { 61 } test_cases[] = {
62 { FILE_PATH_LITERAL(""), FILE_PATH_LITERAL("/") }, 62 { FILE_PATH_LITERAL(""), FILE_PATH_LITERAL("/") },
63 { FILE_PATH_LITERAL("/"), FILE_PATH_LITERAL("/") }, 63 { FILE_PATH_LITERAL("/"), FILE_PATH_LITERAL("/") },
64 { FILE_PATH_LITERAL("foo/bar"), FILE_PATH_LITERAL("/foo/bar") }, 64 { FILE_PATH_LITERAL("foo/bar"), FILE_PATH_LITERAL("/foo/bar") },
65 { FILE_PATH_LITERAL("/foo/bar"), FILE_PATH_LITERAL("/foo/bar") } 65 { FILE_PATH_LITERAL("/foo/bar"), FILE_PATH_LITERAL("/foo/bar") }
66 }; 66 };
67 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_cases); ++i) { 67 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_cases); ++i) {
68 FilePath input = FilePath(test_cases[i].path); 68 base::FilePath input = base::FilePath(test_cases[i].path);
69 FilePath::StringType normalized_path_string = 69 base::FilePath::StringType normalized_path_string =
70 VirtualPath::GetNormalizedFilePath(input); 70 VirtualPath::GetNormalizedFilePath(input);
71 EXPECT_EQ(test_cases[i].normalized_path, normalized_path_string); 71 EXPECT_EQ(test_cases[i].normalized_path, normalized_path_string);
72 } 72 }
73 } 73 }
74 74
75 TEST_F(FileSystemUtilTest, IsAbsolutePath) { 75 TEST_F(FileSystemUtilTest, IsAbsolutePath) {
76 EXPECT_TRUE(VirtualPath::IsAbsolute(FILE_PATH_LITERAL("/"))); 76 EXPECT_TRUE(VirtualPath::IsAbsolute(FILE_PATH_LITERAL("/")));
77 EXPECT_TRUE(VirtualPath::IsAbsolute(FILE_PATH_LITERAL("/foo/bar"))); 77 EXPECT_TRUE(VirtualPath::IsAbsolute(FILE_PATH_LITERAL("/foo/bar")));
78 EXPECT_FALSE(VirtualPath::IsAbsolute(FILE_PATH_LITERAL(""))); 78 EXPECT_FALSE(VirtualPath::IsAbsolute(FILE_PATH_LITERAL("")));
79 EXPECT_FALSE(VirtualPath::IsAbsolute(FILE_PATH_LITERAL("foo/bar"))); 79 EXPECT_FALSE(VirtualPath::IsAbsolute(FILE_PATH_LITERAL("foo/bar")));
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 EXPECT_FALSE(CrackIsolatedFileSystemName("fooIsolatedbar", &fsid)); 143 EXPECT_FALSE(CrackIsolatedFileSystemName("fooIsolatedbar", &fsid));
144 EXPECT_FALSE(CrackIsolatedFileSystemName("foo:Persistent", &fsid)); 144 EXPECT_FALSE(CrackIsolatedFileSystemName("foo:Persistent", &fsid));
145 EXPECT_FALSE(CrackIsolatedFileSystemName("foo:Temporary", &fsid)); 145 EXPECT_FALSE(CrackIsolatedFileSystemName("foo:Temporary", &fsid));
146 EXPECT_FALSE(CrackIsolatedFileSystemName("foo:External", &fsid)); 146 EXPECT_FALSE(CrackIsolatedFileSystemName("foo:External", &fsid));
147 EXPECT_FALSE(CrackIsolatedFileSystemName(":Isolated_bar", &fsid)); 147 EXPECT_FALSE(CrackIsolatedFileSystemName(":Isolated_bar", &fsid));
148 EXPECT_FALSE(CrackIsolatedFileSystemName("foo:Isolated_", &fsid)); 148 EXPECT_FALSE(CrackIsolatedFileSystemName("foo:Isolated_", &fsid));
149 } 149 }
150 150
151 } // namespace (anonymous) 151 } // namespace (anonymous)
152 } // namespace fileapi 152 } // namespace fileapi
OLDNEW
« no previous file with comments | « webkit/fileapi/file_system_util.cc ('k') | webkit/fileapi/isolated_file_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698