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

Side by Side Diff: components/omnibox/browser/in_memory_url_index_unittest.cc

Issue 1878083002: Implement IsAsciiUpper and IsAsciiLower in base/strings/string_util.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: git sync Created 4 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
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 <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 7
8 #include <algorithm> 8 #include <algorithm>
9 #include <fstream> 9 #include <fstream>
10 10
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 241
242 sql::Connection& db(GetDB()); 242 sql::Connection& db(GetDB());
243 ASSERT_TRUE(db.is_open()); 243 ASSERT_TRUE(db.is_open());
244 { 244 {
245 sql::Transaction transaction(&db); 245 sql::Transaction transaction(&db);
246 transaction.Begin(); 246 transaction.Begin();
247 while (!proto_file.eof()) { 247 while (!proto_file.eof()) {
248 proto_file.getline(sql_cmd_line, kCommandBufferMaxSize); 248 proto_file.getline(sql_cmd_line, kCommandBufferMaxSize);
249 if (!proto_file.eof()) { 249 if (!proto_file.eof()) {
250 // We only process lines which begin with a upper-case letter. 250 // We only process lines which begin with a upper-case letter.
251 // TODO(mrossetti): Can iswupper() be used here? 251 if (base::IsAsciiUpper(sql_cmd_line[0])) {
252 if (sql_cmd_line[0] >= 'A' && sql_cmd_line[0] <= 'Z') {
253 std::string sql_cmd(sql_cmd_line); 252 std::string sql_cmd(sql_cmd_line);
254 sql::Statement sql_stmt(db.GetUniqueStatement(sql_cmd_line)); 253 sql::Statement sql_stmt(db.GetUniqueStatement(sql_cmd_line));
255 EXPECT_TRUE(sql_stmt.Run()); 254 EXPECT_TRUE(sql_stmt.Run());
256 } 255 }
257 } 256 }
258 } 257 }
259 transaction.Commit(); 258 transaction.Commit();
260 } 259 }
261 260
262 // Update the last_visit_time table column in the "urls" table 261 // Update the last_visit_time table column in the "urls" table
(...skipping 1047 matching lines...) Expand 10 before | Expand all | Expand 10 after
1310 ASSERT_TRUE(GetCacheFilePath(&full_file_path)); 1309 ASSERT_TRUE(GetCacheFilePath(&full_file_path));
1311 std::vector<base::FilePath::StringType> actual_parts; 1310 std::vector<base::FilePath::StringType> actual_parts;
1312 full_file_path.GetComponents(&actual_parts); 1311 full_file_path.GetComponents(&actual_parts);
1313 ASSERT_EQ(expected_parts.size(), actual_parts.size()); 1312 ASSERT_EQ(expected_parts.size(), actual_parts.size());
1314 size_t count = expected_parts.size(); 1313 size_t count = expected_parts.size();
1315 for (size_t i = 0; i < count; ++i) 1314 for (size_t i = 0; i < count; ++i)
1316 EXPECT_EQ(expected_parts[i], actual_parts[i]); 1315 EXPECT_EQ(expected_parts[i], actual_parts[i]);
1317 // Must clear the history_dir_ to satisfy the dtor's DCHECK. 1316 // Must clear the history_dir_ to satisfy the dtor's DCHECK.
1318 set_history_dir(base::FilePath()); 1317 set_history_dir(base::FilePath());
1319 } 1318 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698