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

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

Issue 308103004: IndexedDB: Using a mock IndexedDBFactory for unit tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Forgot to add mock_indexed_db_factory.* files in last patch set. Created 6 years, 6 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_transaction_unittest.cc
diff --git a/content/browser/indexed_db/indexed_db_transaction_unittest.cc b/content/browser/indexed_db/indexed_db_transaction_unittest.cc
index c6a1244d4dc9717107de1264139c264ed7648aae..35556f9e0ada799811a63484ff2e6a1cfc87379e 100644
--- a/content/browser/indexed_db/indexed_db_transaction_unittest.cc
+++ b/content/browser/indexed_db/indexed_db_transaction_unittest.cc
@@ -8,8 +8,11 @@
#include "base/logging.h"
#include "base/message_loop/message_loop.h"
#include "base/strings/utf_string_conversions.h"
+#include "content/browser/indexed_db/indexed_db_factory.h"
#include "content/browser/indexed_db/indexed_db_fake_backing_store.h"
#include "content/browser/indexed_db/mock_indexed_db_database_callbacks.h"
+#include "content/browser/indexed_db/mock_indexed_db_factory.h"
+#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace content {
@@ -31,7 +34,7 @@ class AbortObserver {
class IndexedDBTransactionTest : public testing::Test {
public:
- IndexedDBTransactionTest() {
+ IndexedDBTransactionTest() : factory_(new MockIndexedDBFactory()) {
backing_store_ = new IndexedDBFakeBackingStore();
CreateDB();
}
@@ -40,11 +43,10 @@ class IndexedDBTransactionTest : public testing::Test {
// DB is created here instead of the constructor to workaround a
// "peculiarity of C++". More info at
// https://code.google.com/p/googletest/wiki/FAQ#My_compiler_complains_that_a_constructor_(or_destructor)_cannot
- IndexedDBFactory* factory = NULL;
leveldb::Status s;
db_ = IndexedDBDatabase::Create(base::ASCIIToUTF16("db"),
backing_store_,
- factory,
+ factory_,
IndexedDBDatabase::Identifier(),
&s);
ASSERT_TRUE(s.ok());
@@ -64,6 +66,7 @@ class IndexedDBTransactionTest : public testing::Test {
private:
base::MessageLoop message_loop_;
+ scoped_refptr<MockIndexedDBFactory> factory_;
DISALLOW_COPY_AND_ASSIGN(IndexedDBTransactionTest);
};
« no previous file with comments | « content/browser/indexed_db/indexed_db_factory.h ('k') | content/browser/indexed_db/mock_indexed_db_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698