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

Side by Side Diff: content/browser/fileapi/file_system_dir_url_request_job_unittest.cc

Issue 1200053004: Move more string_util functions to base namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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
OLDNEW
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 "storage/browser/fileapi/file_system_dir_url_request_job.h" 5 #include "storage/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/file_util.h" 10 #include "base/files/file_util.h"
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 UErrorCode status = U_ZERO_ERROR; 258 UErrorCode status = U_ZERO_ERROR;
259 icu::RegexMatcher match(pattern, input, 0, status); 259 icu::RegexMatcher match(pattern, input, 0, status);
260 260
261 EXPECT_TRUE(match.find()); 261 EXPECT_TRUE(match.find());
262 EXPECT_EQ(5, match.groupCount()); 262 EXPECT_EQ(5, match.groupCount());
263 EXPECT_EQ(icu::UnicodeString(name.c_str()), match.group(1, status)); 263 EXPECT_EQ(icu::UnicodeString(name.c_str()), match.group(1, status));
264 EXPECT_EQ(icu::UnicodeString(url.c_str()), match.group(2, status)); 264 EXPECT_EQ(icu::UnicodeString(url.c_str()), match.group(2, status));
265 EXPECT_EQ(icu::UnicodeString(is_directory ? "1" : "0"), 265 EXPECT_EQ(icu::UnicodeString(is_directory ? "1" : "0"),
266 match.group(3, status)); 266 match.group(3, status));
267 if (size >= 0) { 267 if (size >= 0) {
268 icu::UnicodeString size_string(FormatBytesUnlocalized(size).c_str()); 268 icu::UnicodeString size_string(
269 base::FormatBytesUnlocalized(size).c_str());
269 EXPECT_EQ(size_string, match.group(4, status)); 270 EXPECT_EQ(size_string, match.group(4, status));
270 } 271 }
271 272
272 base::Time date; 273 base::Time date;
273 icu::UnicodeString date_ustr(match.group(5, status)); 274 icu::UnicodeString date_ustr(match.group(5, status));
274 std::string date_str; 275 std::string date_str;
275 base::UTF16ToUTF8(date_ustr.getBuffer(), date_ustr.length(), &date_str); 276 base::UTF16ToUTF8(date_ustr.getBuffer(), date_ustr.length(), &date_str);
276 EXPECT_TRUE(base::Time::FromString(date_str.c_str(), &date)); 277 EXPECT_TRUE(base::Time::FromString(date_str.c_str(), &date));
277 EXPECT_FALSE(date.is_null()); 278 EXPECT_FALSE(date.is_null());
278 } 279 }
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 ASSERT_FALSE(request_->status().is_success()); 447 ASSERT_FALSE(request_->status().is_success());
447 EXPECT_EQ(net::ERR_FILE_NOT_FOUND, request_->status().error()); 448 EXPECT_EQ(net::ERR_FILE_NOT_FOUND, request_->status().error());
448 449
449 ASSERT_FALSE( 450 ASSERT_FALSE(
450 storage::ExternalMountPoints::GetSystemInstance()->RevokeFileSystem( 451 storage::ExternalMountPoints::GetSystemInstance()->RevokeFileSystem(
451 kValidExternalMountPoint)); 452 kValidExternalMountPoint));
452 } 453 }
453 454
454 } // namespace 455 } // namespace
455 } // namespace content 456 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698