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

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

Issue 1996443003: Return number of values deleted by IDBObjectStore.delete(range) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Delete Range 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
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 7ca56ff5e80438e8690b69f262f88c544435ddb2..c049019db82c7b0c16a0b90d7108dbd91c6710a9 100644
--- a/content/browser/indexed_db/indexed_db_backing_store_unittest.cc
+++ b/content/browser/indexed_db/indexed_db_backing_store_unittest.cc
@@ -459,10 +459,12 @@ TEST_F(IndexedDBBackingStoreTest, PutGetConsistencyWithBlobs) {
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();
@@ -547,8 +549,12 @@ 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]).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();
@@ -637,8 +643,12 @@ 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]).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();
@@ -732,10 +742,12 @@ TEST_F(IndexedDBBackingStoreTest, LiveBlobJournal) {
{
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_callbacks.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698