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

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: Merge out 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..46a26ecf9c1c9e7abbd5dfbf72db628483f4206c 100644
--- a/content/browser/indexed_db/indexed_db_database_unittest.cc
+++ b/content/browser/indexed_db/indexed_db_database_unittest.cc
@@ -23,6 +23,10 @@
using base::ASCIIToUTF16;
+namespace {
+const int FAKE_CHILD_PROCESS_ID = 0;
+}
+
namespace content {
TEST(IndexedDBDatabaseTest, BackingStoreRetention) {
@@ -59,10 +63,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,
+ FAKE_CHILD_PROCESS_ID,
+ transaction_id1,
+ IndexedDBDatabaseMetadata::DEFAULT_INT_VERSION);
+ db->OpenConnection(connection1);
EXPECT_FALSE(backing_store->HasOneRef()); // db, connection count > 0
@@ -70,10 +77,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,
+ FAKE_CHILD_PROCESS_ID,
+ transaction_id2,
+ IndexedDBDatabaseMetadata::DEFAULT_INT_VERSION);
+ db->OpenConnection(connection2);
EXPECT_FALSE(backing_store->HasOneRef()); // local and connection
@@ -109,10 +119,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,
+ 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 +180,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,
+ FAKE_CHILD_PROCESS_ID,
+ transaction_id1,
+ IndexedDBDatabaseMetadata::DEFAULT_INT_VERSION);
+ db->OpenConnection(connection);
EXPECT_FALSE(backing_store->HasOneRef()); // local and db
« no previous file with comments | « content/browser/indexed_db/indexed_db_database.cc ('k') | content/browser/indexed_db/indexed_db_dispatcher_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698