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

Unified Diff: content/browser/indexed_db/indexed_db_cleanup_on_io_error_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: Fix override mismatch 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_cleanup_on_io_error_unittest.cc
diff --git a/content/browser/indexed_db/indexed_db_cleanup_on_io_error_unittest.cc b/content/browser/indexed_db/indexed_db_cleanup_on_io_error_unittest.cc
index b09720798cbb7946dc21e0632033dd977a6a90c7..a3e2d03f71b7176cc1af0c40db982eeea88ad3ab 100644
--- a/content/browser/indexed_db/indexed_db_cleanup_on_io_error_unittest.cc
+++ b/content/browser/indexed_db/indexed_db_cleanup_on_io_error_unittest.cc
@@ -21,6 +21,14 @@ using content::LevelDBDatabase;
using content::LevelDBFactory;
using content::LevelDBSnapshot;
+namespace base {
+class TaskRunner;
+}
+
+namespace content {
+class IndexedDBFactory;
+}
+
namespace {
class BustedLevelDBDatabase : public LevelDBDatabase {
@@ -62,6 +70,7 @@ class MockLevelDBFactory : public LevelDBFactory {
};
TEST(IndexedDBIOErrorTest, CleanUpTest) {
+ content::IndexedDBFactory* factory = NULL;
const GURL origin("http://localhost:81");
base::ScopedTempDir temp_directory;
ASSERT_TRUE(temp_directory.CreateUniqueTempDir());
@@ -71,13 +80,16 @@ TEST(IndexedDBIOErrorTest, CleanUpTest) {
blink::WebIDBDataLossNone;
std::string data_loss_message;
bool disk_full = false;
+ base::TaskRunner* task_runner = NULL;
scoped_refptr<IndexedDBBackingStore> backing_store =
- IndexedDBBackingStore::Open(origin,
+ IndexedDBBackingStore::Open(factory,
+ origin,
path,
&data_loss,
&data_loss_message,
&disk_full,
- &mock_leveldb_factory);
+ &mock_leveldb_factory,
+ task_runner);
}
// TODO(dgrogan): Remove expect_destroy if we end up not using it again. It is
@@ -114,6 +126,7 @@ class MockErrorLevelDBFactory : public LevelDBFactory {
};
TEST(IndexedDBNonRecoverableIOErrorTest, NuancedCleanupTest) {
+ content::IndexedDBFactory* factory = NULL;
const GURL origin("http://localhost:81");
base::ScopedTempDir temp_directory;
ASSERT_TRUE(temp_directory.CreateUniqueTempDir());
@@ -122,44 +135,53 @@ TEST(IndexedDBNonRecoverableIOErrorTest, NuancedCleanupTest) {
blink::WebIDBDataLossNone;
std::string data_loss_reason;
bool disk_full = false;
+ base::TaskRunner* task_runner = NULL;
MockErrorLevelDBFactory<int> mock_leveldb_factory(ENOSPC, false);
scoped_refptr<IndexedDBBackingStore> backing_store =
- IndexedDBBackingStore::Open(origin,
+ IndexedDBBackingStore::Open(factory,
+ origin,
path,
&data_loss,
&data_loss_reason,
&disk_full,
- &mock_leveldb_factory);
+ &mock_leveldb_factory,
+ task_runner);
MockErrorLevelDBFactory<base::File::Error> mock_leveldb_factory2(
base::File::FILE_ERROR_NO_MEMORY, false);
scoped_refptr<IndexedDBBackingStore> backing_store2 =
- IndexedDBBackingStore::Open(origin,
+ IndexedDBBackingStore::Open(factory,
+ origin,
path,
&data_loss,
&data_loss_reason,
&disk_full,
- &mock_leveldb_factory2);
+ &mock_leveldb_factory2,
+ task_runner);
MockErrorLevelDBFactory<int> mock_leveldb_factory3(EIO, false);
scoped_refptr<IndexedDBBackingStore> backing_store3 =
- IndexedDBBackingStore::Open(origin,
+ IndexedDBBackingStore::Open(factory,
+ origin,
path,
&data_loss,
&data_loss_reason,
&disk_full,
- &mock_leveldb_factory3);
+ &mock_leveldb_factory3,
+ task_runner);
MockErrorLevelDBFactory<base::File::Error> mock_leveldb_factory4(
base::File::FILE_ERROR_FAILED, false);
scoped_refptr<IndexedDBBackingStore> backing_store4 =
- IndexedDBBackingStore::Open(origin,
+ IndexedDBBackingStore::Open(factory,
+ origin,
path,
&data_loss,
&data_loss_reason,
&disk_full,
- &mock_leveldb_factory4);
+ &mock_leveldb_factory4,
+ task_runner);
}
} // namespace
« no previous file with comments | « content/browser/indexed_db/indexed_db_backing_store_unittest.cc ('k') | content/browser/indexed_db/indexed_db_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698