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

Unified Diff: content/browser/indexed_db/indexed_db_factory_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_factory_unittest.cc
diff --git a/content/browser/indexed_db/indexed_db_factory_unittest.cc b/content/browser/indexed_db/indexed_db_factory_unittest.cc
index ef045e5b889ab67a908b38fea04287e31b0631d3..10380353ac426581b0c6a9c94c2301c5b7e5894b 100644
--- a/content/browser/indexed_db/indexed_db_factory_unittest.cc
+++ b/content/browser/indexed_db/indexed_db_factory_unittest.cc
@@ -218,13 +218,13 @@ TEST_F(IndexedDBFactoryTest, QuotaErrorOnDiskFull) {
scoped_refptr<IndexedDBDatabaseCallbacks> dummy_database_callbacks =
new IndexedDBDatabaseCallbacks(NULL, 0, 0);
const base::string16 name(ASCIIToUTF16("name"));
- factory->Open(name,
- 1, /* version */
- 2, /* transaction_id */
- callbacks,
- dummy_database_callbacks,
- origin,
- base::FilePath(FILE_PATH_LITERAL("/dummy")));
+ IndexedDBPendingConnection connection(callbacks,
+ dummy_database_callbacks,
+ 0, /* child_process_id */
+ 2, /* transaction_id */
+ 1 /* version */);
+ factory->Open(
+ name, connection, origin, base::FilePath(FILE_PATH_LITERAL("/dummy")));
}
TEST_F(IndexedDBFactoryTest, BackingStoreReleasedOnForcedClose) {
@@ -239,13 +239,13 @@ TEST_F(IndexedDBFactoryTest, BackingStoreReleasedOnForcedClose) {
scoped_refptr<MockIndexedDBDatabaseCallbacks> db_callbacks(
new MockIndexedDBDatabaseCallbacks());
const int64 transaction_id = 1;
- factory->Open(ASCIIToUTF16("db"),
- IndexedDBDatabaseMetadata::DEFAULT_INT_VERSION,
- transaction_id,
- callbacks,
- db_callbacks,
- origin,
- temp_directory.path());
+ IndexedDBPendingConnection connection(
+ callbacks,
+ db_callbacks,
+ 0, /* child_process_id */
+ transaction_id,
+ IndexedDBDatabaseMetadata::DEFAULT_INT_VERSION);
+ factory->Open(ASCIIToUTF16("db"), connection, origin, temp_directory.path());
EXPECT_TRUE(callbacks->connection());
@@ -270,13 +270,13 @@ TEST_F(IndexedDBFactoryTest, BackingStoreReleaseDelayedOnClose) {
scoped_refptr<MockIndexedDBDatabaseCallbacks> db_callbacks(
new MockIndexedDBDatabaseCallbacks());
const int64 transaction_id = 1;
- factory->Open(ASCIIToUTF16("db"),
- IndexedDBDatabaseMetadata::DEFAULT_INT_VERSION,
- transaction_id,
- callbacks,
- db_callbacks,
- origin,
- temp_directory.path());
+ IndexedDBPendingConnection connection(
+ callbacks,
+ db_callbacks,
+ 0, /* child_process_id */
+ transaction_id,
+ IndexedDBDatabaseMetadata::DEFAULT_INT_VERSION);
+ factory->Open(ASCIIToUTF16("db"), connection, origin, temp_directory.path());
EXPECT_TRUE(callbacks->connection());
IndexedDBBackingStore* store =
@@ -365,13 +365,13 @@ TEST_F(IndexedDBFactoryTest, ForceCloseReleasesBackingStore) {
scoped_refptr<MockIndexedDBDatabaseCallbacks> db_callbacks(
new MockIndexedDBDatabaseCallbacks());
const int64 transaction_id = 1;
- factory->Open(ASCIIToUTF16("db"),
- IndexedDBDatabaseMetadata::DEFAULT_INT_VERSION,
- transaction_id,
- callbacks,
- db_callbacks,
- origin,
- temp_directory.path());
+ IndexedDBPendingConnection connection(
+ callbacks,
+ db_callbacks,
+ 0, /* child_process_id */
+ transaction_id,
+ IndexedDBDatabaseMetadata::DEFAULT_INT_VERSION);
+ factory->Open(ASCIIToUTF16("db"), connection, origin, temp_directory.path());
EXPECT_TRUE(callbacks->connection());
EXPECT_TRUE(factory->IsBackingStoreOpen(origin));
@@ -442,13 +442,12 @@ TEST_F(IndexedDBFactoryTest, DatabaseFailedOpen) {
{
scoped_refptr<MockIndexedDBCallbacks> callbacks(
new UpgradeNeededCallbacks());
- factory->Open(db_name,
- db_version,
- transaction_id,
- callbacks,
- db_callbacks,
- origin,
- temp_directory.path());
+ IndexedDBPendingConnection connection(callbacks,
+ db_callbacks,
+ 0, /* child_process_id */
+ transaction_id,
+ db_version);
+ factory->Open(db_name, connection, origin, temp_directory.path());
EXPECT_TRUE(factory->IsDatabaseOpen(origin, db_name));
// Pump the message loop so the upgrade transaction can run.
@@ -464,13 +463,12 @@ TEST_F(IndexedDBFactoryTest, DatabaseFailedOpen) {
// the database object.
{
scoped_refptr<IndexedDBCallbacks> callbacks(new ErrorCallbacks());
- factory->Open(db_name,
- db_version - 1,
- transaction_id,
- callbacks,
- db_callbacks,
- origin,
- temp_directory.path());
+ IndexedDBPendingConnection connection(callbacks,
+ db_callbacks,
+ 0, /* child_process_id */
+ transaction_id,
+ db_version - 1);
+ factory->Open(db_name, connection, origin, temp_directory.path());
EXPECT_FALSE(factory->IsDatabaseOpen(origin, db_name));
}
« no previous file with comments | « content/browser/indexed_db/indexed_db_factory.cc ('k') | content/browser/indexed_db/indexed_db_pending_connection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698