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

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

Issue 2708223002: 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 ca6ee07e3197c44309033f11357f4c4292b0e6c6..3406b3b040332773dcbe2ee017620b6caef3e8de 100644
--- a/content/browser/indexed_db/indexed_db_backing_store_unittest.cc
+++ b/content/browser/indexed_db/indexed_db_backing_store_unittest.cc
@@ -473,12 +473,10 @@ TEST_F(IndexedDBBackingStoreTest, PutGetConsistencyWithBlobs) {
IndexedDBBackingStore::Transaction transaction3(backing_store_.get());
transaction3.Begin();
IndexedDBValue result_value;
- size_t delete_count = 0;
- EXPECT_TRUE(backing_store_
- ->DeleteRange(&transaction3, 1, 1,
- IndexedDBKeyRange(m_key3), &delete_count)
- .ok());
- EXPECT_EQ(1UL, delete_count);
+ EXPECT_TRUE(
+ backing_store_
+ ->DeleteRange(&transaction3, 1, 1, IndexedDBKeyRange(m_key3))
+ .ok());
scoped_refptr<TestCallback> callback(new TestCallback());
EXPECT_TRUE(transaction3.CommitPhaseOne(callback).ok());
task_runner_->RunUntilIdle();
@@ -563,12 +561,8 @@ TEST_F(IndexedDBBackingStoreTest, DeleteRange) {
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], &delete_count)
- .ok());
- EXPECT_EQ(2UL, delete_count);
+ backing_store_->DeleteRange(&transaction2, 1, i + 1, ranges[i]).ok());
scoped_refptr<TestCallback> callback(new TestCallback());
EXPECT_TRUE(transaction2.CommitPhaseOne(callback).ok());
task_runner_->RunUntilIdle();
@@ -657,12 +651,8 @@ TEST_F(IndexedDBBackingStoreTest, DeleteRangeEmptyRange) {
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], &delete_count)
- .ok());
- EXPECT_EQ(0UL, delete_count);
+ backing_store_->DeleteRange(&transaction2, 1, i + 1, ranges[i]).ok());
scoped_refptr<TestCallback> callback(new TestCallback());
EXPECT_TRUE(transaction2.CommitPhaseOne(callback).ok());
task_runner_->RunUntilIdle();
@@ -756,12 +746,10 @@ TEST_F(IndexedDBBackingStoreTest, LiveBlobJournal) {
{
IndexedDBBackingStore::Transaction transaction3(backing_store_.get());
transaction3.Begin();
- size_t delete_count = 0;
- EXPECT_TRUE(backing_store_
- ->DeleteRange(&transaction3, 1, 1,
- IndexedDBKeyRange(m_key3), &delete_count)
- .ok());
- EXPECT_EQ(1UL, delete_count);
+ EXPECT_TRUE(
+ backing_store_
+ ->DeleteRange(&transaction3, 1, 1, IndexedDBKeyRange(m_key3))
+ .ok());
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