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

Side by Side Diff: net/ftp/ftp_directory_listing_parser_unittest.h

Issue 112963005: Update uses of UTF conversions in courgette/, device/, extensions/, google_apis/, gpu/, ipc/, media… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 12 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #ifndef NET_FTP_FTP_DIRECTORY_LISTING_PARSER_UNITTEST_H_ 5 #ifndef NET_FTP_FTP_DIRECTORY_LISTING_PARSER_UNITTEST_H_
6 #define NET_FTP_FTP_DIRECTORY_LISTING_PARSER_UNITTEST_H_ 6 #define NET_FTP_FTP_DIRECTORY_LISTING_PARSER_UNITTEST_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 14 matching lines...) Expand all
25 int day_of_month; 25 int day_of_month;
26 int hour; 26 int hour;
27 int minute; 27 int minute;
28 }; 28 };
29 29
30 protected: 30 protected:
31 FtpDirectoryListingParserTest() {} 31 FtpDirectoryListingParserTest() {}
32 32
33 std::vector<base::string16> GetSingleLineTestCase(const std::string& text) { 33 std::vector<base::string16> GetSingleLineTestCase(const std::string& text) {
34 std::vector<base::string16> lines; 34 std::vector<base::string16> lines;
35 lines.push_back(UTF8ToUTF16(text)); 35 lines.push_back(base::UTF8ToUTF16(text));
36 return lines; 36 return lines;
37 } 37 }
38 38
39 void VerifySingleLineTestCase( 39 void VerifySingleLineTestCase(
40 const SingleLineTestData& test_case, 40 const SingleLineTestData& test_case,
41 const std::vector<FtpDirectoryListingEntry>& entries) { 41 const std::vector<FtpDirectoryListingEntry>& entries) {
42 ASSERT_FALSE(entries.empty()); 42 ASSERT_FALSE(entries.empty());
43 43
44 FtpDirectoryListingEntry entry = entries[0]; 44 FtpDirectoryListingEntry entry = entries[0];
45 EXPECT_EQ(test_case.type, entry.type); 45 EXPECT_EQ(test_case.type, entry.type);
46 EXPECT_EQ(UTF8ToUTF16(test_case.filename), entry.name); 46 EXPECT_EQ(base::UTF8ToUTF16(test_case.filename), entry.name);
47 EXPECT_EQ(test_case.size, entry.size); 47 EXPECT_EQ(test_case.size, entry.size);
48 48
49 base::Time::Exploded time_exploded; 49 base::Time::Exploded time_exploded;
50 entry.last_modified.LocalExplode(&time_exploded); 50 entry.last_modified.LocalExplode(&time_exploded);
51 51
52 // Only test members displayed on the directory listing. 52 // Only test members displayed on the directory listing.
53 EXPECT_EQ(test_case.year, time_exploded.year); 53 EXPECT_EQ(test_case.year, time_exploded.year);
54 EXPECT_EQ(test_case.month, time_exploded.month); 54 EXPECT_EQ(test_case.month, time_exploded.month);
55 EXPECT_EQ(test_case.day_of_month, time_exploded.day_of_month); 55 EXPECT_EQ(test_case.day_of_month, time_exploded.day_of_month);
56 EXPECT_EQ(test_case.hour, time_exploded.hour); 56 EXPECT_EQ(test_case.hour, time_exploded.hour);
(...skipping 10 matching lines...) Expand all
67 mock_current_time_exploded.hour = 12; 67 mock_current_time_exploded.hour = 12;
68 mock_current_time_exploded.minute = 45; 68 mock_current_time_exploded.minute = 45;
69 return base::Time::FromLocalExploded(mock_current_time_exploded); 69 return base::Time::FromLocalExploded(mock_current_time_exploded);
70 } 70 }
71 }; 71 };
72 72
73 } // namespace net 73 } // namespace net
74 74
75 #endif // NET_FTP_FTP_DIRECTORY_LISTING_PARSER_UNITTEST_H_ 75 #endif // NET_FTP_FTP_DIRECTORY_LISTING_PARSER_UNITTEST_H_
76 76
OLDNEW
« no previous file with comments | « net/ftp/ftp_directory_listing_parser_netware_unittest.cc ('k') | net/ftp/ftp_directory_listing_parser_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698