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

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

Issue 13145003: Rewrite std::string("") to std::string(), Linux edition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ugh Created 7 years, 8 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
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/files/file_path.h" 7 #include "base/files/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_url.h" 10 #include "webkit/fileapi/file_system_url.h"
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 base::FilePath input = base::FilePath(test_cases[i].path); 108 base::FilePath input = base::FilePath(test_cases[i].path);
109 base::FilePath::StringType normalized_path_string = 109 base::FilePath::StringType normalized_path_string =
110 VirtualPath::GetNormalizedFilePath(input); 110 VirtualPath::GetNormalizedFilePath(input);
111 EXPECT_EQ(test_cases[i].normalized_path, normalized_path_string); 111 EXPECT_EQ(test_cases[i].normalized_path, normalized_path_string);
112 } 112 }
113 } 113 }
114 114
115 TEST_F(FileSystemUtilTest, IsAbsolutePath) { 115 TEST_F(FileSystemUtilTest, IsAbsolutePath) {
116 EXPECT_TRUE(VirtualPath::IsAbsolute(FILE_PATH_LITERAL("/"))); 116 EXPECT_TRUE(VirtualPath::IsAbsolute(FILE_PATH_LITERAL("/")));
117 EXPECT_TRUE(VirtualPath::IsAbsolute(FILE_PATH_LITERAL("/foo/bar"))); 117 EXPECT_TRUE(VirtualPath::IsAbsolute(FILE_PATH_LITERAL("/foo/bar")));
118 EXPECT_FALSE(VirtualPath::IsAbsolute(FILE_PATH_LITERAL(""))); 118 EXPECT_FALSE(VirtualPath::IsAbsolute(base::FilePath::StringType()));
119 EXPECT_FALSE(VirtualPath::IsAbsolute(FILE_PATH_LITERAL("foo/bar"))); 119 EXPECT_FALSE(VirtualPath::IsAbsolute(FILE_PATH_LITERAL("foo/bar")));
120 } 120 }
121 121
122 TEST_F(FileSystemUtilTest, VirtualPathGetComponents) { 122 TEST_F(FileSystemUtilTest, VirtualPathGetComponents) {
123 struct test_data { 123 struct test_data {
124 const base::FilePath::StringType path; 124 const base::FilePath::StringType path;
125 size_t count; 125 size_t count;
126 const base::FilePath::StringType components[3]; 126 const base::FilePath::StringType components[3];
127 } test_cases[] = { 127 } test_cases[] = {
128 { FILE_PATH_LITERAL("foo/bar"), 128 { FILE_PATH_LITERAL("foo/bar"),
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 215
216 EXPECT_TRUE(AreSameFileSystem(url_foo_temp_a, url_foo_temp_a)); 216 EXPECT_TRUE(AreSameFileSystem(url_foo_temp_a, url_foo_temp_a));
217 EXPECT_TRUE(AreSameFileSystem(url_foo_temp_a, url_foo_temp_b)); 217 EXPECT_TRUE(AreSameFileSystem(url_foo_temp_a, url_foo_temp_b));
218 EXPECT_FALSE(AreSameFileSystem(url_foo_temp_a, url_foo_perm_a)); 218 EXPECT_FALSE(AreSameFileSystem(url_foo_temp_a, url_foo_perm_a));
219 EXPECT_FALSE(AreSameFileSystem(url_foo_temp_a, url_bar_temp_a)); 219 EXPECT_FALSE(AreSameFileSystem(url_foo_temp_a, url_bar_temp_a));
220 EXPECT_FALSE(AreSameFileSystem(url_foo_temp_a, url_bar_perm_a)); 220 EXPECT_FALSE(AreSameFileSystem(url_foo_temp_a, url_bar_perm_a));
221 } 221 }
222 222
223 } // namespace (anonymous) 223 } // namespace (anonymous)
224 } // namespace fileapi 224 } // namespace fileapi
OLDNEW
« no previous file with comments | « webkit/fileapi/file_system_origin_database.cc ('k') | webkit/fileapi/local_file_stream_writer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698