OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/file_system_dir_url_request_job.h" | 5 #include "webkit/browser/fileapi/file_system_dir_url_request_job.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 EXPECT_EQ(icu::UnicodeString(name.c_str()), match.group(1, status)); | 173 EXPECT_EQ(icu::UnicodeString(name.c_str()), match.group(1, status)); |
174 EXPECT_EQ(icu::UnicodeString(url.c_str()), match.group(2, status)); | 174 EXPECT_EQ(icu::UnicodeString(url.c_str()), match.group(2, status)); |
175 EXPECT_EQ(icu::UnicodeString(is_directory ? "1" : "0"), | 175 EXPECT_EQ(icu::UnicodeString(is_directory ? "1" : "0"), |
176 match.group(3, status)); | 176 match.group(3, status)); |
177 icu::UnicodeString size_string(FormatBytesUnlocalized(size).c_str()); | 177 icu::UnicodeString size_string(FormatBytesUnlocalized(size).c_str()); |
178 EXPECT_EQ(size_string, match.group(4, status)); | 178 EXPECT_EQ(size_string, match.group(4, status)); |
179 | 179 |
180 base::Time date; | 180 base::Time date; |
181 icu::UnicodeString date_ustr(match.group(5, status)); | 181 icu::UnicodeString date_ustr(match.group(5, status)); |
182 std::string date_str; | 182 std::string date_str; |
183 UTF16ToUTF8(date_ustr.getBuffer(), date_ustr.length(), &date_str); | 183 base::UTF16ToUTF8(date_ustr.getBuffer(), date_ustr.length(), &date_str); |
184 EXPECT_TRUE(base::Time::FromString(date_str.c_str(), &date)); | 184 EXPECT_TRUE(base::Time::FromString(date_str.c_str(), &date)); |
185 EXPECT_FALSE(date.is_null()); | 185 EXPECT_FALSE(date.is_null()); |
186 } | 186 } |
187 | 187 |
188 GURL CreateFileSystemURL(const std::string path) { | 188 GURL CreateFileSystemURL(const std::string path) { |
189 return GURL(kFileSystemURLPrefix + path); | 189 return GURL(kFileSystemURLPrefix + path); |
190 } | 190 } |
191 | 191 |
192 static net::URLRequestJob* FileSystemDirURLRequestJobFactory( | 192 static net::URLRequestJob* FileSystemDirURLRequestJobFactory( |
193 net::URLRequest* request, | 193 net::URLRequest* request, |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 | 312 |
313 TestRequestWithContext(CreateFileSystemURL("foo"), | 313 TestRequestWithContext(CreateFileSystemURL("foo"), |
314 file_system_context.get()); | 314 file_system_context.get()); |
315 ASSERT_FALSE(request_->is_pending()); | 315 ASSERT_FALSE(request_->is_pending()); |
316 ASSERT_FALSE(request_->status().is_success()); | 316 ASSERT_FALSE(request_->status().is_success()); |
317 EXPECT_EQ(net::ERR_FILE_NOT_FOUND, request_->status().error()); | 317 EXPECT_EQ(net::ERR_FILE_NOT_FOUND, request_->status().error()); |
318 } | 318 } |
319 | 319 |
320 } // namespace (anonymous) | 320 } // namespace (anonymous) |
321 } // namespace fileapi | 321 } // namespace fileapi |
OLD | NEW |