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

Unified Diff: sql/connection_unittest.cc

Issue 2083543003: Updates SQL code now that mmap is supported on iOS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 | « sql/connection.cc ('k') | sql/sqlite_features_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sql/connection_unittest.cc
diff --git a/sql/connection_unittest.cc b/sql/connection_unittest.cc
index 2618bb4ace00bd749702398426e77889c759d0e5..41d7f4fc55aff8735e9403cacaf12ed54f19b1d3 100644
--- a/sql/connection_unittest.cc
+++ b/sql/connection_unittest.cc
@@ -25,6 +25,10 @@
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/sqlite/sqlite3.h"
+#if defined(OS_IOS) && defined(USE_SYSTEM_SQLITE)
+#include "base/ios/ios_util.h"
+#endif
+
namespace sql {
namespace test {
@@ -1435,13 +1439,15 @@ TEST_F(SQLConnectionTest, MmapInitiallyEnabled) {
}
}
-// Test specific operation of the GetAppropriateMmapSize() helper.
-#if defined(OS_IOS)
-TEST_F(SQLConnectionTest, GetAppropriateMmapSize) {
- ASSERT_EQ(0UL, db().GetAppropriateMmapSize());
-}
-#else
TEST_F(SQLConnectionTest, GetAppropriateMmapSize) {
+#if defined(OS_IOS) && defined(USE_SYSTEM_SQLITE)
+ // Mmap is not supported on iOS9.
+ if (!base::ios::IsRunningOnIOS10OrLater()) {
+ ASSERT_EQ(0UL, db().GetAppropriateMmapSize());
+ return;
+ }
+#endif
+
const size_t kMmapAlot = 25 * 1024 * 1024;
int64_t mmap_status = MetaTable::kMmapFailure;
@@ -1477,7 +1483,6 @@ TEST_F(SQLConnectionTest, GetAppropriateMmapSize) {
ASSERT_TRUE(MetaTable::GetMmapStatus(&db(), &mmap_status));
ASSERT_EQ(MetaTable::kMmapSuccess, mmap_status);
}
-#endif
// To prevent invalid SQL from accidentally shipping to production, prepared
// statements which fail to compile with SQLITE_ERROR call DLOG(FATAL). This
« no previous file with comments | « sql/connection.cc ('k') | sql/sqlite_features_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698