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

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

Issue 18023022: Blob support for IDB [Chromium] (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use ScopedVector and stl_utils for BlobDataHandles. Created 7 years 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 d94454159596c9c908d4a2d4b6d6fe70836af5b9..bd7434b3bc227fa3a0dd8381e6ceecf58bb62494 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
@@ -20,6 +20,18 @@ using content::LevelDBDatabase;
using content::LevelDBFactory;
using content::LevelDBSnapshot;
+namespace base {
+class TaskRunner;
+}
+
+namespace content {
+class IndexedDBFactory;
+}
+
+namespace net {
+class URLRequestContext;
+}
+
namespace {
class BustedLevelDBDatabase : public LevelDBDatabase {
@@ -61,22 +73,30 @@ 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());
const base::FilePath path = temp_directory.path();
+ net::URLRequestContext* request_context = NULL;
MockLevelDBFactory mock_leveldb_factory;
blink::WebIDBDataLoss data_loss =
blink::WebIDBDataLossNone;
std::string data_loss_message;
bool disk_full = false;
+ base::TaskRunner* task_runner = NULL;
+ bool clean_journal = false;
scoped_refptr<IndexedDBBackingStore> backing_store =
- IndexedDBBackingStore::Open(origin,
+ IndexedDBBackingStore::Open(factory,
+ origin,
path,
+ request_context,
&data_loss,
&data_loss_message,
&disk_full,
- &mock_leveldb_factory);
+ &mock_leveldb_factory,
+ task_runner,
+ clean_journal);
}
// TODO(dgrogan): Remove expect_destroy if we end up not using it again. It is
@@ -112,7 +132,9 @@ class MockErrorLevelDBFactory : public LevelDBFactory {
};
TEST(IndexedDBNonRecoverableIOErrorTest, NuancedCleanupTest) {
+ content::IndexedDBFactory* factory = NULL;
const GURL origin("http://localhost:81");
+ net::URLRequestContext* request_context = NULL;
base::ScopedTempDir temp_directory;
ASSERT_TRUE(temp_directory.CreateUniqueTempDir());
const base::FilePath path = temp_directory.path();
@@ -120,44 +142,62 @@ TEST(IndexedDBNonRecoverableIOErrorTest, NuancedCleanupTest) {
blink::WebIDBDataLossNone;
std::string data_loss_reason;
bool disk_full = false;
+ base::TaskRunner* task_runner = NULL;
+ bool clean_journal = false;
MockErrorLevelDBFactory<int> mock_leveldb_factory(ENOSPC, false);
scoped_refptr<IndexedDBBackingStore> backing_store =
- IndexedDBBackingStore::Open(origin,
+ IndexedDBBackingStore::Open(factory,
+ origin,
path,
+ request_context,
&data_loss,
&data_loss_reason,
&disk_full,
- &mock_leveldb_factory);
+ &mock_leveldb_factory,
+ task_runner,
+ clean_journal);
MockErrorLevelDBFactory<base::PlatformFileError> mock_leveldb_factory2(
base::PLATFORM_FILE_ERROR_NO_MEMORY, false);
scoped_refptr<IndexedDBBackingStore> backing_store2 =
- IndexedDBBackingStore::Open(origin,
+ IndexedDBBackingStore::Open(factory,
+ origin,
path,
+ request_context,
&data_loss,
&data_loss_reason,
&disk_full,
- &mock_leveldb_factory2);
+ &mock_leveldb_factory2,
+ task_runner,
+ clean_journal);
MockErrorLevelDBFactory<int> mock_leveldb_factory3(EIO, false);
scoped_refptr<IndexedDBBackingStore> backing_store3 =
- IndexedDBBackingStore::Open(origin,
+ IndexedDBBackingStore::Open(factory,
+ origin,
path,
+ request_context,
&data_loss,
&data_loss_reason,
&disk_full,
- &mock_leveldb_factory3);
+ &mock_leveldb_factory3,
+ task_runner,
+ clean_journal);
MockErrorLevelDBFactory<base::PlatformFileError> mock_leveldb_factory4(
base::PLATFORM_FILE_ERROR_FAILED, false);
scoped_refptr<IndexedDBBackingStore> backing_store4 =
- IndexedDBBackingStore::Open(origin,
+ IndexedDBBackingStore::Open(factory,
+ origin,
path,
+ request_context,
&data_loss,
&data_loss_reason,
&disk_full,
- &mock_leveldb_factory4);
+ &mock_leveldb_factory4,
+ task_runner,
+ clean_journal);
}
} // namespace

Powered by Google App Engine
This is Rietveld 408576698