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

Unified Diff: components/history/core/browser/history_backend_db_unittest.cc

Issue 1897153005: Make SQL in DownloadDatabase SQLite pre 3.8.3 compatible (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: char() was added by 3.7.16 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/history/core/browser/download_database.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/history/core/browser/history_backend_db_unittest.cc
diff --git a/components/history/core/browser/history_backend_db_unittest.cc b/components/history/core/browser/history_backend_db_unittest.cc
index 42bbe51168638c147dc755699a8e2b49d1903767..229650a5479652f12988ca740bacc36fcd1e695c 100644
--- a/components/history/core/browser/history_backend_db_unittest.cc
+++ b/components/history/core/browser/history_backend_db_unittest.cc
@@ -601,12 +601,15 @@ TEST_F(HistoryBackendDBTest, MigrateHashHttpMethodAndGenerateGuids) {
EXPECT_EQ(cur_version, s.ColumnInt(0));
}
{
- sql::Statement s(db.GetUniqueStatement("SELECT guid from downloads"));
+ sql::Statement s(db.GetUniqueStatement("SELECT guid, id from downloads"));
std::unordered_set<std::string> guids;
while (s.Step()) {
std::string guid = s.ColumnString(0);
+ uint32_t id = static_cast<uint32_t>(s.ColumnInt64(1));
EXPECT_TRUE(IsValidRFC4122Ver4GUID(guid));
EXPECT_EQ(guid, base::ToUpperASCII(guid));
+ // Id is used as time_low in RFC 4122 to guarantee unique GUIDs
+ EXPECT_EQ(guid.substr(0, 8), base::StringPrintf("%08" PRIX32, id));
guids.insert(guid);
}
EXPECT_TRUE(s.Succeeded());
« no previous file with comments | « components/history/core/browser/download_database.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698