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

Unified Diff: components/dom_distiller/core/dom_distiller_test_util.cc

Issue 330833002: Extract protobuf database into a new 'leveldb_proto' component (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix test 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
« no previous file with comments | « components/dom_distiller/core/dom_distiller_test_util.h ('k') | components/dom_distiller/core/fake_db.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/dom_distiller/core/dom_distiller_test_util.cc
diff --git a/components/dom_distiller/core/dom_distiller_test_util.cc b/components/dom_distiller/core/dom_distiller_test_util.cc
index f9164fd63be81574635264571fabe6b949ad1e90..45ddf86e8bba5e20f7428d7d436400bbba7c55e7 100644
--- a/components/dom_distiller/core/dom_distiller_test_util.cc
+++ b/components/dom_distiller/core/dom_distiller_test_util.cc
@@ -7,17 +7,19 @@
#include "components/dom_distiller/core/dom_distiller_store.h"
#include "components/dom_distiller/core/fake_distiller.h"
+using leveldb_proto::test::FakeDB;
+
namespace dom_distiller {
namespace test {
namespace util {
namespace {
-std::vector<ArticleEntry> EntryMapToList(const FakeDB::EntryMap& entries) {
+std::vector<ArticleEntry> EntryMapToList(
+ const FakeDB<ArticleEntry>::EntryMap& entries) {
std::vector<ArticleEntry> entry_list;
- for (FakeDB::EntryMap::const_iterator it = entries.begin();
- it != entries.end();
- ++it) {
+ for (FakeDB<ArticleEntry>::EntryMap::const_iterator it = entries.begin();
+ it != entries.end(); ++it) {
entry_list.push_back(it->second);
}
return entry_list;
@@ -39,8 +41,7 @@ bool ObserverUpdatesMatcher::MatchAndExplain(
std::vector<DomDistillerObserver::ArticleUpdate>::const_iterator expected,
actual;
for (expected = expected_updates_.begin(), actual = actual_updates.begin();
- expected != expected_updates_.end();
- ++expected, ++actual) {
+ expected != expected_updates_.end(); ++expected, ++actual) {
if (expected->entry_id != actual->entry_id) {
*listener << " Mismatched entry id. Expected: " << expected->entry_id
<< " actual: " << actual->entry_id;
@@ -60,8 +61,7 @@ void ObserverUpdatesMatcher::DescribeUpdates(std::ostream* os) const {
bool start = true;
for (std::vector<DomDistillerObserver::ArticleUpdate>::const_iterator i =
expected_updates_.begin();
- i != expected_updates_.end();
- ++i) {
+ i != expected_updates_.end(); ++i) {
if (start) {
start = false;
} else {
@@ -90,12 +90,12 @@ HasExpectedUpdates(
}
// static
-DomDistillerStore* CreateStoreWithFakeDB(FakeDB* fake_db,
- const FakeDB::EntryMap& store_model) {
+DomDistillerStore* CreateStoreWithFakeDB(
+ FakeDB<ArticleEntry>* fake_db,
+ const FakeDB<ArticleEntry>::EntryMap& store_model) {
return new DomDistillerStore(
- scoped_ptr<DomDistillerDatabaseInterface>(fake_db),
- EntryMapToList(store_model),
- FakeDB::DirectoryForTestDB());
+ scoped_ptr<leveldb_proto::ProtoDatabase<ArticleEntry> >(fake_db),
+ EntryMapToList(store_model), FakeDB<ArticleEntry>::DirectoryForTestDB());
}
} // namespace util
« no previous file with comments | « components/dom_distiller/core/dom_distiller_test_util.h ('k') | components/dom_distiller/core/fake_db.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698