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

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

Issue 203833003: Add the IndexedDBActiveBlobRegistry, currently unused, to enable future blob (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Code review feedback rolled in. 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 10380353ac426581b0c6a9c94c2301c5b7e5894b..a4a9569b3977d9192dcd1ec11a3889cc89f05a2a 100644
--- a/content/browser/indexed_db/indexed_db_factory_unittest.cc
+++ b/content/browser/indexed_db/indexed_db_factory_unittest.cc
@@ -49,7 +49,8 @@ class MockIDBFactory : public IndexedDBFactory {
data_directory,
&data_loss,
&data_loss_message,
- &disk_full);
+ &disk_full,
+ NULL /* task_runner */);
EXPECT_EQ(blink::WebIDBDataLossNone, data_loss);
return backing_store;
}
@@ -189,7 +190,8 @@ class DiskFullFactory : public IndexedDBFactory {
const base::FilePath& data_directory,
blink::WebIDBDataLoss* data_loss,
std::string* data_loss_message,
- bool* disk_full) OVERRIDE {
+ bool* disk_full,
+ base::TaskRunner* task_runner) OVERRIDE {
*disk_full = true;
return scoped_refptr<IndexedDBBackingStore>();
}
@@ -211,6 +213,8 @@ class LookingForQuotaErrorMockCallbacks : public IndexedDBCallbacks {
TEST_F(IndexedDBFactoryTest, QuotaErrorOnDiskFull) {
const GURL origin("http://localhost:81");
+ base::ScopedTempDir temp_directory;
+ ASSERT_TRUE(temp_directory.CreateUniqueTempDir());
scoped_refptr<DiskFullFactory> factory = new DiskFullFactory;
scoped_refptr<LookingForQuotaErrorMockCallbacks> callbacks =
@@ -224,7 +228,7 @@ TEST_F(IndexedDBFactoryTest, QuotaErrorOnDiskFull) {
2, /* transaction_id */
1 /* version */);
factory->Open(
- name, connection, origin, base::FilePath(FILE_PATH_LITERAL("/dummy")));
+ name, connection, origin, temp_directory.path(), NULL /* task_runner */);
}
TEST_F(IndexedDBFactoryTest, BackingStoreReleasedOnForcedClose) {
@@ -245,7 +249,11 @@ TEST_F(IndexedDBFactoryTest, BackingStoreReleasedOnForcedClose) {
0, /* child_process_id */
transaction_id,
IndexedDBDatabaseMetadata::DEFAULT_INT_VERSION);
- factory->Open(ASCIIToUTF16("db"), connection, origin, temp_directory.path());
+ factory->Open(ASCIIToUTF16("db"),
+ connection,
+ origin,
+ temp_directory.path(),
+ NULL /* task_runner */);
EXPECT_TRUE(callbacks->connection());
@@ -276,7 +284,11 @@ TEST_F(IndexedDBFactoryTest, BackingStoreReleaseDelayedOnClose) {
0, /* child_process_id */
transaction_id,
IndexedDBDatabaseMetadata::DEFAULT_INT_VERSION);
- factory->Open(ASCIIToUTF16("db"), connection, origin, temp_directory.path());
+ factory->Open(ASCIIToUTF16("db"),
+ connection,
+ origin,
+ temp_directory.path(),
+ NULL /* task_runner */);
EXPECT_TRUE(callbacks->connection());
IndexedDBBackingStore* store =
@@ -315,7 +327,8 @@ TEST_F(IndexedDBFactoryTest, DeleteDatabaseClosesBackingStore) {
factory->DeleteDatabase(ASCIIToUTF16("db"),
callbacks,
origin,
- temp_directory.path());
+ temp_directory.path(),
+ NULL /* task_runner */);
EXPECT_TRUE(factory->IsBackingStoreOpen(origin));
EXPECT_TRUE(factory->IsBackingStorePendingClose(origin));
@@ -339,9 +352,8 @@ TEST_F(IndexedDBFactoryTest, GetDatabaseNamesClosesBackingStore) {
const bool expect_connection = false;
scoped_refptr<MockIndexedDBCallbacks> callbacks(
new MockIndexedDBCallbacks(expect_connection));
- factory->GetDatabaseNames(callbacks,
- origin,
- temp_directory.path());
+ factory->GetDatabaseNames(
+ callbacks, origin, temp_directory.path(), NULL /* task_runner */);
EXPECT_TRUE(factory->IsBackingStoreOpen(origin));
EXPECT_TRUE(factory->IsBackingStorePendingClose(origin));
@@ -371,7 +383,11 @@ TEST_F(IndexedDBFactoryTest, ForceCloseReleasesBackingStore) {
0, /* child_process_id */
transaction_id,
IndexedDBDatabaseMetadata::DEFAULT_INT_VERSION);
- factory->Open(ASCIIToUTF16("db"), connection, origin, temp_directory.path());
+ factory->Open(ASCIIToUTF16("db"),
+ connection,
+ origin,
+ temp_directory.path(),
+ NULL /* task_runner */);
EXPECT_TRUE(callbacks->connection());
EXPECT_TRUE(factory->IsBackingStoreOpen(origin));
@@ -447,7 +463,11 @@ TEST_F(IndexedDBFactoryTest, DatabaseFailedOpen) {
0, /* child_process_id */
transaction_id,
db_version);
- factory->Open(db_name, connection, origin, temp_directory.path());
+ factory->Open(db_name,
+ connection,
+ origin,
+ temp_directory.path(),
+ NULL /* task_runner */);
EXPECT_TRUE(factory->IsDatabaseOpen(origin, db_name));
// Pump the message loop so the upgrade transaction can run.
@@ -468,7 +488,11 @@ TEST_F(IndexedDBFactoryTest, DatabaseFailedOpen) {
0, /* child_process_id */
transaction_id,
db_version - 1);
- factory->Open(db_name, connection, origin, temp_directory.path());
+ factory->Open(db_name,
+ connection,
+ origin,
+ temp_directory.path(),
+ NULL /* task_runner */);
EXPECT_FALSE(factory->IsDatabaseOpen(origin, db_name));
}

Powered by Google App Engine
This is Rietveld 408576698