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

Unified Diff: content/browser/indexed_db/indexed_db_backing_store_unittest.cc

Issue 2710203002: Revert of IndexedDB: Optimize range deletion operations (e.g. clearing a store) (Closed)
Patch Set: Created 3 years, 10 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
Index: content/browser/indexed_db/indexed_db_backing_store_unittest.cc
diff --git a/content/browser/indexed_db/indexed_db_backing_store_unittest.cc b/content/browser/indexed_db/indexed_db_backing_store_unittest.cc
index 3406b3b040332773dcbe2ee017620b6caef3e8de..ca6ee07e3197c44309033f11357f4c4292b0e6c6 100644
--- a/content/browser/indexed_db/indexed_db_backing_store_unittest.cc
+++ b/content/browser/indexed_db/indexed_db_backing_store_unittest.cc
@@ -473,10 +473,12 @@
IndexedDBBackingStore::Transaction transaction3(backing_store_.get());
transaction3.Begin();
IndexedDBValue result_value;
- EXPECT_TRUE(
- backing_store_
- ->DeleteRange(&transaction3, 1, 1, IndexedDBKeyRange(m_key3))
- .ok());
+ size_t delete_count = 0;
+ EXPECT_TRUE(backing_store_
+ ->DeleteRange(&transaction3, 1, 1,
+ IndexedDBKeyRange(m_key3), &delete_count)
+ .ok());
+ EXPECT_EQ(1UL, delete_count);
scoped_refptr<TestCallback> callback(new TestCallback());
EXPECT_TRUE(transaction3.CommitPhaseOne(callback).ok());
task_runner_->RunUntilIdle();
@@ -561,8 +563,12 @@
IndexedDBBackingStore::Transaction transaction2(backing_store_.get());
transaction2.Begin();
IndexedDBValue result_value;
+ size_t delete_count = 0;
EXPECT_TRUE(
- backing_store_->DeleteRange(&transaction2, 1, i + 1, ranges[i]).ok());
+ backing_store_
+ ->DeleteRange(&transaction2, 1, i + 1, ranges[i], &delete_count)
+ .ok());
+ EXPECT_EQ(2UL, delete_count);
scoped_refptr<TestCallback> callback(new TestCallback());
EXPECT_TRUE(transaction2.CommitPhaseOne(callback).ok());
task_runner_->RunUntilIdle();
@@ -651,8 +657,12 @@
IndexedDBBackingStore::Transaction transaction2(backing_store_.get());
transaction2.Begin();
IndexedDBValue result_value;
+ size_t delete_count = 0;
EXPECT_TRUE(
- backing_store_->DeleteRange(&transaction2, 1, i + 1, ranges[i]).ok());
+ backing_store_
+ ->DeleteRange(&transaction2, 1, i + 1, ranges[i], &delete_count)
+ .ok());
+ EXPECT_EQ(0UL, delete_count);
scoped_refptr<TestCallback> callback(new TestCallback());
EXPECT_TRUE(transaction2.CommitPhaseOne(callback).ok());
task_runner_->RunUntilIdle();
@@ -746,10 +756,12 @@
{
IndexedDBBackingStore::Transaction transaction3(backing_store_.get());
transaction3.Begin();
- EXPECT_TRUE(
- backing_store_
- ->DeleteRange(&transaction3, 1, 1, IndexedDBKeyRange(m_key3))
- .ok());
+ size_t delete_count = 0;
+ EXPECT_TRUE(backing_store_
+ ->DeleteRange(&transaction3, 1, 1,
+ IndexedDBKeyRange(m_key3), &delete_count)
+ .ok());
+ EXPECT_EQ(1UL, delete_count);
scoped_refptr<TestCallback> callback(new TestCallback());
EXPECT_TRUE(transaction3.CommitPhaseOne(callback).ok());
task_runner_->RunUntilIdle();
« no previous file with comments | « content/browser/indexed_db/indexed_db_backing_store.cc ('k') | content/browser/indexed_db/indexed_db_database.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698