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

Unified Diff: components/download/internal/model_impl_unittest.cc

Issue 2881173003: Download Service : Added leveldb proto layer (Closed)
Patch Set: more comments Created 3 years, 7 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: components/download/internal/model_impl_unittest.cc
diff --git a/components/download/internal/model_impl_unittest.cc b/components/download/internal/model_impl_unittest.cc
index 19a78391702979755d00f60e52e570bc48f72d65..5520296cff64bfcdfd44809a699b685424bc10ec 100644
--- a/components/download/internal/model_impl_unittest.cc
+++ b/components/download/internal/model_impl_unittest.cc
@@ -75,8 +75,8 @@ TEST_F(DownloadServiceModelImplTest, SuccessfulInitWithEntries) {
EXPECT_TRUE(store_->init_called());
store_->TriggerInit(true, base::MakeUnique<std::vector<Entry>>(entries));
- EXPECT_TRUE(test::SuperficialEntryCompare(&entry1, model_->Get(entry1.guid)));
- EXPECT_TRUE(test::SuperficialEntryCompare(&entry2, model_->Get(entry2.guid)));
+ EXPECT_TRUE(test::CompareEntry(&entry1, model_->Get(entry1.guid)));
+ EXPECT_TRUE(test::CompareEntry(&entry2, model_->Get(entry2.guid)));
}
TEST_F(DownloadServiceModelImplTest, BadInit) {
@@ -114,15 +114,13 @@ TEST_F(DownloadServiceModelImplTest, Add) {
store_->TriggerInit(true, base::MakeUnique<std::vector<Entry>>());
model_->Add(entry1);
- EXPECT_TRUE(test::SuperficialEntryCompare(&entry1, model_->Get(entry1.guid)));
- EXPECT_TRUE(
- test::SuperficialEntryCompare(&entry1, store_->LastUpdatedEntry()));
+ EXPECT_TRUE(test::CompareEntry(&entry1, model_->Get(entry1.guid)));
+ EXPECT_TRUE(test::CompareEntry(&entry1, store_->LastUpdatedEntry()));
store_->TriggerUpdate(true);
model_->Add(entry2);
- EXPECT_TRUE(test::SuperficialEntryCompare(&entry2, model_->Get(entry2.guid)));
- EXPECT_TRUE(
- test::SuperficialEntryCompare(&entry2, store_->LastUpdatedEntry()));
+ EXPECT_TRUE(test::CompareEntry(&entry2, model_->Get(entry2.guid)));
+ EXPECT_TRUE(test::CompareEntry(&entry2, store_->LastUpdatedEntry()));
store_->TriggerUpdate(false);
EXPECT_EQ(nullptr, model_->Get(entry2.guid));
@@ -150,18 +148,16 @@ TEST_F(DownloadServiceModelImplTest, Update) {
store_->TriggerInit(true, base::MakeUnique<std::vector<Entry>>(entries));
model_->Update(entry2);
- EXPECT_TRUE(test::SuperficialEntryCompare(&entry2, model_->Get(entry2.guid)));
- EXPECT_TRUE(
- test::SuperficialEntryCompare(&entry2, store_->LastUpdatedEntry()));
+ EXPECT_TRUE(test::CompareEntry(&entry2, model_->Get(entry2.guid)));
+ EXPECT_TRUE(test::CompareEntry(&entry2, store_->LastUpdatedEntry()));
store_->TriggerUpdate(true);
model_->Update(entry3);
- EXPECT_TRUE(test::SuperficialEntryCompare(&entry3, model_->Get(entry3.guid)));
- EXPECT_TRUE(
- test::SuperficialEntryCompare(&entry3, store_->LastUpdatedEntry()));
+ EXPECT_TRUE(test::CompareEntry(&entry3, model_->Get(entry3.guid)));
+ EXPECT_TRUE(test::CompareEntry(&entry3, store_->LastUpdatedEntry()));
store_->TriggerUpdate(false);
- EXPECT_TRUE(test::SuperficialEntryCompare(&entry3, model_->Get(entry3.guid)));
+ EXPECT_TRUE(test::CompareEntry(&entry3, model_->Get(entry3.guid)));
}
TEST_F(DownloadServiceModelImplTest, Remove) {
@@ -201,7 +197,7 @@ TEST_F(DownloadServiceModelImplTest, Get) {
model_->Initialize();
store_->TriggerInit(true, base::MakeUnique<std::vector<Entry>>(entries));
- EXPECT_TRUE(test::SuperficialEntryCompare(&entry, model_->Get(entry.guid)));
+ EXPECT_TRUE(test::CompareEntry(&entry, model_->Get(entry.guid)));
EXPECT_EQ(nullptr, model_->Get(base::GenerateGUID()));
}
@@ -218,8 +214,7 @@ TEST_F(DownloadServiceModelImplTest, PeekEntries) {
std::vector<Entry*> expected_peek = {&entry1, &entry2};
- EXPECT_TRUE(
- test::SuperficialEntryListCompare(expected_peek, model_->PeekEntries()));
+ EXPECT_TRUE(test::CompareEntryList(expected_peek, model_->PeekEntries()));
}
TEST_F(DownloadServiceModelImplTest, TestRemoveAfterAdd) {
@@ -234,7 +229,7 @@ TEST_F(DownloadServiceModelImplTest, TestRemoveAfterAdd) {
store_->TriggerInit(true, base::MakeUnique<std::vector<Entry>>());
model_->Add(entry);
- EXPECT_TRUE(test::SuperficialEntryCompare(&entry, model_->Get(entry.guid)));
+ EXPECT_TRUE(test::CompareEntry(&entry, model_->Get(entry.guid)));
model_->Remove(entry.guid);
EXPECT_EQ(nullptr, model_->Get(entry.guid));
@@ -259,10 +254,10 @@ TEST_F(DownloadServiceModelImplTest, TestRemoveAfterUpdate) {
model_->Initialize();
store_->TriggerInit(true, base::MakeUnique<std::vector<Entry>>(entries));
- EXPECT_TRUE(test::SuperficialEntryCompare(&entry1, model_->Get(entry1.guid)));
+ EXPECT_TRUE(test::CompareEntry(&entry1, model_->Get(entry1.guid)));
model_->Update(entry2);
- EXPECT_TRUE(test::SuperficialEntryCompare(&entry2, model_->Get(entry2.guid)));
+ EXPECT_TRUE(test::CompareEntry(&entry2, model_->Get(entry2.guid)));
model_->Remove(entry2.guid);
EXPECT_EQ(nullptr, model_->Get(entry2.guid));

Powered by Google App Engine
This is Rietveld 408576698