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

Side by Side Diff: chrome/browser/history/in_memory_url_index_unittest.cc

Issue 10948045: introduce chrome/browser/common directory and move url_database(and its dependencies) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 3 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 <algorithm> 5 #include <algorithm>
6 #include <fstream> 6 #include <fstream>
7 7
8 #include "base/file_path.h" 8 #include "base/file_path.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 } 223 }
224 } 224 }
225 } 225 }
226 transaction.Commit(); 226 transaction.Commit();
227 } 227 }
228 proto_file.close(); 228 proto_file.close();
229 229
230 // Update the last_visit_time table column 230 // Update the last_visit_time table column
231 // such that it represents a time relative to 'now'. 231 // such that it represents a time relative to 'now'.
232 sql::Statement statement(db.GetUniqueStatement( 232 sql::Statement statement(db.GetUniqueStatement(
233 "SELECT" HISTORY_URL_ROW_FIELDS "FROM urls;")); 233 "SELECT" URL_DATABASE_ROW_FIELDS "FROM urls;"));
234 ASSERT_TRUE(statement.is_valid()); 234 ASSERT_TRUE(statement.is_valid());
235 base::Time time_right_now = base::Time::NowFromSystemTime(); 235 base::Time time_right_now = base::Time::NowFromSystemTime();
236 base::TimeDelta day_delta = base::TimeDelta::FromDays(1); 236 base::TimeDelta day_delta = base::TimeDelta::FromDays(1);
237 { 237 {
238 sql::Transaction transaction(&db); 238 sql::Transaction transaction(&db);
239 transaction.Begin(); 239 transaction.Begin();
240 while (statement.Step()) { 240 while (statement.Step()) {
241 URLRow row; 241 URLRow row;
242 history_database_->FillURLRow(statement, &row); 242 history_database_->FillURLRow(statement, &row);
243 base::Time last_visit = time_right_now; 243 base::Time last_visit = time_right_now;
(...skipping 704 matching lines...) Expand 10 before | Expand all | Expand 10 after
948 full_file_path.GetComponents(&actual_parts); 948 full_file_path.GetComponents(&actual_parts);
949 ASSERT_EQ(expected_parts.size(), actual_parts.size()); 949 ASSERT_EQ(expected_parts.size(), actual_parts.size());
950 size_t count = expected_parts.size(); 950 size_t count = expected_parts.size();
951 for (size_t i = 0; i < count; ++i) 951 for (size_t i = 0; i < count; ++i)
952 EXPECT_EQ(expected_parts[i], actual_parts[i]); 952 EXPECT_EQ(expected_parts[i], actual_parts[i]);
953 // Must clear the history_dir_ to satisfy the dtor's DCHECK. 953 // Must clear the history_dir_ to satisfy the dtor's DCHECK.
954 set_history_dir(FilePath()); 954 set_history_dir(FilePath());
955 } 955 }
956 956
957 } // namespace history 957 } // namespace history
OLDNEW
« no previous file with comments | « chrome/browser/history/in_memory_url_index.cc ('k') | chrome/browser/history/text_database_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698