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

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

Issue 198223002: Added IndexedDBPendingConnection to group up a bunch of parameters that get (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add missing file. Created 6 years, 9 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 902e004357b07f31f74789b9ab1146d35574f33a..b3e053b7b9f508ad2ee849452afda381650eefd4 100644
--- a/content/browser/indexed_db/indexed_db_database_unittest.cc
+++ b/content/browser/indexed_db/indexed_db_database_unittest.cc
@@ -59,10 +59,13 @@ TEST(IndexedDBDatabaseTest, ConnectionLifecycle) {
scoped_refptr<MockIndexedDBDatabaseCallbacks> callbacks1(
new MockIndexedDBDatabaseCallbacks());
const int64 transaction_id1 = 1;
- db->OpenConnection(request1,
- callbacks1,
- transaction_id1,
- IndexedDBDatabaseMetadata::DEFAULT_INT_VERSION);
+ IndexedDBPendingConnection connection1(
+ request1,
+ callbacks1,
+ 0 /* fake child_process_id */,
jsbell 2014/03/12 23:40:49 For consistency, make this a const int?
ericu 2014/03/12 23:56:37 Done.
+ transaction_id1,
+ IndexedDBDatabaseMetadata::DEFAULT_INT_VERSION);
+ db->OpenConnection(connection1);
EXPECT_FALSE(backing_store->HasOneRef()); // db, connection count > 0
@@ -70,10 +73,13 @@ TEST(IndexedDBDatabaseTest, ConnectionLifecycle) {
scoped_refptr<MockIndexedDBDatabaseCallbacks> callbacks2(
new MockIndexedDBDatabaseCallbacks());
const int64 transaction_id2 = 2;
- db->OpenConnection(request2,
- callbacks2,
- transaction_id2,
- IndexedDBDatabaseMetadata::DEFAULT_INT_VERSION);
+ IndexedDBPendingConnection connection2(
+ request2,
+ callbacks2,
+ 0 /* fake child_process_id */,
+ transaction_id2,
+ IndexedDBDatabaseMetadata::DEFAULT_INT_VERSION);
+ db->OpenConnection(connection2);
EXPECT_FALSE(backing_store->HasOneRef()); // local and connection
@@ -109,10 +115,13 @@ TEST(IndexedDBDatabaseTest, ForcedClose) {
new MockIndexedDBDatabaseCallbacks());
scoped_refptr<MockIndexedDBCallbacks> request(new MockIndexedDBCallbacks());
const int64 upgrade_transaction_id = 3;
- database->OpenConnection(request,
- callbacks,
- upgrade_transaction_id,
- IndexedDBDatabaseMetadata::DEFAULT_INT_VERSION);
+ IndexedDBPendingConnection connection(
+ request,
+ callbacks,
+ 0 /* fake child_process_id */,
+ upgrade_transaction_id,
+ IndexedDBDatabaseMetadata::DEFAULT_INT_VERSION);
+ database->OpenConnection(connection);
EXPECT_EQ(database, request->connection()->database());
const int64 transaction_id = 123;
@@ -167,10 +176,13 @@ TEST(IndexedDBDatabaseTest, PendingDelete) {
scoped_refptr<MockIndexedDBDatabaseCallbacks> callbacks1(
new MockIndexedDBDatabaseCallbacks());
const int64 transaction_id1 = 1;
- db->OpenConnection(request1,
- callbacks1,
- transaction_id1,
- IndexedDBDatabaseMetadata::DEFAULT_INT_VERSION);
+ IndexedDBPendingConnection connection(
+ request1,
+ callbacks1,
+ 0 /* fake child_process_id */,
+ transaction_id1,
+ IndexedDBDatabaseMetadata::DEFAULT_INT_VERSION);
+ db->OpenConnection(connection);
EXPECT_FALSE(backing_store->HasOneRef()); // local and db

Powered by Google App Engine
This is Rietveld 408576698