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

Side by Side Diff: content/browser/indexed_db/indexed_db_database_unittest.cc

Issue 2506773002: [IndexedDB] Integrating failures and corruption with transaction (Closed)
Patch Set: Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/indexed_db/indexed_db_database.h" 5 #include "content/browser/indexed_db/indexed_db_database.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <set> 8 #include <set>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 333
334 // Final delete request should also run. 334 // Final delete request should also run.
335 EXPECT_TRUE(request2->success_called()); 335 EXPECT_TRUE(request2->success_called());
336 336
337 // And everything else should be complete. 337 // And everything else should be complete.
338 EXPECT_EQ(db->ConnectionCount(), 0UL); 338 EXPECT_EQ(db->ConnectionCount(), 0UL);
339 EXPECT_EQ(db->ActiveOpenDeleteCount(), 0UL); 339 EXPECT_EQ(db->ActiveOpenDeleteCount(), 0UL);
340 EXPECT_EQ(db->PendingOpenDeleteCount(), 0UL); 340 EXPECT_EQ(db->PendingOpenDeleteCount(), 0UL);
341 } 341 }
342 342
343 void DummyOperation(IndexedDBTransaction* transaction) { 343 leveldb::Status DummyOperation(IndexedDBTransaction* transaction) {
344 return leveldb::Status::OK();
344 } 345 }
345 346
346 class IndexedDBDatabaseOperationTest : public testing::Test { 347 class IndexedDBDatabaseOperationTest : public testing::Test {
347 public: 348 public:
348 IndexedDBDatabaseOperationTest() 349 IndexedDBDatabaseOperationTest()
349 : commit_success_(leveldb::Status::OK()), 350 : commit_success_(leveldb::Status::OK()),
350 factory_(new MockIndexedDBFactory()) {} 351 factory_(new MockIndexedDBFactory()) {}
351 352
352 void SetUp() override { 353 void SetUp() override {
353 backing_store_ = new IndexedDBFakeBackingStore(); 354 backing_store_ = new IndexedDBFakeBackingStore();
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
523 EXPECT_EQ(1ULL, db_->metadata().object_stores.size()); 524 EXPECT_EQ(1ULL, db_->metadata().object_stores.size());
524 525
525 // This will execute the Put then Delete. 526 // This will execute the Put then Delete.
526 RunPostedTasks(); 527 RunPostedTasks();
527 EXPECT_EQ(0ULL, db_->metadata().object_stores.size()); 528 EXPECT_EQ(0ULL, db_->metadata().object_stores.size());
528 529
529 transaction_->Commit(); // Cleans up the object hierarchy. 530 transaction_->Commit(); // Cleans up the object hierarchy.
530 } 531 }
531 532
532 } // namespace content 533 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698