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

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

Issue 2160163002: [IndexedDB] Propogating Changes to Observer : Browser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Browser changes Created 4 years, 5 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_database_unittest.cc
diff --git a/content/browser/indexed_db/indexed_db_database_unittest.cc b/content/browser/indexed_db/indexed_db_database_unittest.cc
index f01c413e100cf59a30ae49b0656fbc86eee55a86..1ade603165a2c3e7bf1a18411e8e6180b054c0d4 100644
--- a/content/browser/indexed_db/indexed_db_database_unittest.cc
+++ b/content/browser/indexed_db/indexed_db_database_unittest.cc
@@ -11,6 +11,7 @@
#include "base/auto_reset.h"
#include "base/logging.h"
#include "base/macros.h"
+#include "base/memory/ptr_util.h"
#include "base/run_loop.h"
#include "base/strings/string16.h"
#include "base/strings/utf_string_conversions.h"
@@ -238,9 +239,11 @@ class IndexedDBDatabaseOperationTest : public testing::Test {
IndexedDBDatabaseMetadata::DEFAULT_VERSION));
EXPECT_EQ(IndexedDBDatabaseMetadata::NO_VERSION, db_->metadata().version);
+ connection_ = base::WrapUnique(new IndexedDBConnection(db_, callbacks_));
transaction_ = IndexedDBClassFactory::Get()->CreateIndexedDBTransaction(
- transaction_id, callbacks_, std::set<int64_t>() /*scope*/,
- blink::WebIDBTransactionModeVersionChange, db_.get(),
+ transaction_id, connection_->GetWeakPtr(),
+ std::set<int64_t>() /*scope*/,
+ blink::WebIDBTransactionModeVersionChange,
new IndexedDBFakeBackingStore::FakeTransaction(commit_success_));
db_->TransactionCreated(transaction_.get());
@@ -258,6 +261,7 @@ class IndexedDBDatabaseOperationTest : public testing::Test {
scoped_refptr<MockIndexedDBCallbacks> request_;
scoped_refptr<MockIndexedDBDatabaseCallbacks> callbacks_;
scoped_refptr<IndexedDBTransaction> transaction_;
+ std::unique_ptr<IndexedDBConnection> connection_;
leveldb::Status commit_success_;

Powered by Google App Engine
This is Rietveld 408576698