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

Unified Diff: chrome/browser/history/top_sites_unittest.cc

Issue 6371001: A quick fix for TopSitesMigrationTest.Migrate... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/test/data/top_sites/history.19.sql » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/history/top_sites_unittest.cc
===================================================================
--- chrome/browser/history/top_sites_unittest.cc (revision 71581)
+++ chrome/browser/history/top_sites_unittest.cc (working copy)
@@ -5,6 +5,7 @@
#include "app/l10n_util.h"
#include "base/command_line.h"
#include "base/file_util.h"
+#include "base/format_macros.h"
#include "base/path_service.h"
#include "base/scoped_temp_dir.h"
#include "base/string_util.h"
@@ -382,6 +383,16 @@
const FilePath& db_path) {
std::string sql;
ASSERT_TRUE(file_util::ReadFileToString(sql_path, &sql));
+
+ // Replace the 'last_visit_time', 'visit_time', 'time_slot' values in this
+ // SQL with the current time.
+ int64 now = base::Time::Now().ToInternalValue();
+ std::vector<std::string> sql_time;
+ sql_time.push_back(StringPrintf("%" PRId64, now)); // last_visit_time
+ sql_time.push_back(StringPrintf("%" PRId64, now)); // visit_time
+ sql_time.push_back(StringPrintf("%" PRId64, now)); // time_slot
+ sql = ReplaceStringPlaceholders(sql, sql_time, NULL);
+
sql::Connection connection;
ASSERT_TRUE(connection.Open(db_path));
ASSERT_TRUE(connection.Execute(sql.c_str()));
« no previous file with comments | « no previous file | chrome/test/data/top_sites/history.19.sql » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698