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

Unified Diff: sql/sqlite_features_unittest.cc

Issue 827523004: [sql] Enable HAVE_USLEEP for more platforms. (Closed) Base URL: http://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase to trunk Created 5 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 | third_party/sqlite/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sql/sqlite_features_unittest.cc
diff --git a/sql/sqlite_features_unittest.cc b/sql/sqlite_features_unittest.cc
index 1aff80e9bbac20d11dfe40c9e90e0021166de30c..987d3a1f5d193ccb2b398a047266fa2db4d34d74 100644
--- a/sql/sqlite_features_unittest.cc
+++ b/sql/sqlite_features_unittest.cc
@@ -112,4 +112,21 @@ TEST_F(SQLiteFeaturesTest, FTS3_Prefix) {
}
#endif
+#if !defined(USE_SYSTEM_SQLITE)
+// Verify that Chromium's SQLite is compiled with HAVE_USLEEP defined. With
+// HAVE_USLEEP, SQLite uses usleep() with millisecond granularity. Otherwise it
+// uses sleep() with second granularity.
+TEST_F(SQLiteFeaturesTest, UsesUsleep) {
+ base::TimeTicks before = base::TimeTicks::Now();
+ sqlite3_sleep(1);
+ base::TimeDelta delta = base::TimeTicks::Now() - before;
+
+ // It is not impossible for this to be over 1000 if things are compiled the
+ // right way. But it is very unlikely, most platforms seem to be around
+ // <TBD>.
+ LOG(ERROR) << "Milliseconds: " << delta.InMilliseconds();
+ EXPECT_LT(delta.InMilliseconds(), 1000);
+}
+#endif
+
} // namespace
« no previous file with comments | « no previous file | third_party/sqlite/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698