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

Unified Diff: ios/chrome/browser/reading_list/reading_list_web_state_observer_unittest.mm

Issue 2647763005: Store the distilled_url in Reading List entry in Reading List on iOS. (Closed)
Patch Set: feedback Created 3 years, 11 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 | « ios/chrome/browser/reading_list/reading_list_download_service.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/reading_list/reading_list_web_state_observer_unittest.mm
diff --git a/ios/chrome/browser/reading_list/reading_list_web_state_observer_unittest.mm b/ios/chrome/browser/reading_list/reading_list_web_state_observer_unittest.mm
index 43d8f04f1535ce892aedc72980db593dc83a06e3..692625dadf375e8d287b25dbf6b33473c5a82600 100644
--- a/ios/chrome/browser/reading_list/reading_list_web_state_observer_unittest.mm
+++ b/ios/chrome/browser/reading_list/reading_list_web_state_observer_unittest.mm
@@ -19,6 +19,7 @@ namespace {
const char kTestURL[] = "http://foo.bar";
const char kTestTitle[] = "title";
const char kTestDistilledPath[] = "distilled/page.html";
+const char kTestDistilledURL[] = "http://foo.bar/distilled";
}
// A Test navigation manager that checks if Reload was called.
@@ -87,12 +88,13 @@ TEST_F(ReadingListWebStateObserverTest, TestLoadReadingListFailure) {
EXPECT_FALSE(entry->IsRead());
}
-// Tests that loading an online version of an entry.
+// Tests that loading an online version of an entry does not alter navigation
+// stack and mark entry read.
TEST_F(ReadingListWebStateObserverTest, TestLoadReadingListOnline) {
GURL url(kTestURL);
std::string distilled_path = kTestDistilledPath;
- reading_list_model_->SetEntryDistilledPath(url,
- base::FilePath(distilled_path));
+ reading_list_model_->SetEntryDistilledInfo(
+ url, base::FilePath(distilled_path), GURL(kTestDistilledURL));
const ReadingListEntry* entry = reading_list_model_->GetEntryByURL(url);
GURL distilled_url =
reading_list::DistilledURLForPath(entry->DistilledPath(), entry->URL());
@@ -110,12 +112,13 @@ TEST_F(ReadingListWebStateObserverTest, TestLoadReadingListOnline) {
EXPECT_TRUE(entry->IsRead());
}
-// Tests that loading a distilled version of an entry from a commited entry.
+// Tests that loading an online version of an entry does update navigation
+// stack and mark entry read.
TEST_F(ReadingListWebStateObserverTest, TestLoadReadingListDistilledCommitted) {
GURL url(kTestURL);
std::string distilled_path = kTestDistilledPath;
- reading_list_model_->SetEntryDistilledPath(url,
- base::FilePath(distilled_path));
+ reading_list_model_->SetEntryDistilledInfo(
+ url, base::FilePath(distilled_path), GURL(kTestDistilledURL));
const ReadingListEntry* entry = reading_list_model_->GetEntryByURL(url);
GURL distilled_url =
reading_list::DistilledURLForPath(entry->DistilledPath(), entry->URL());
@@ -135,12 +138,13 @@ TEST_F(ReadingListWebStateObserverTest, TestLoadReadingListDistilledCommitted) {
EXPECT_TRUE(entry->IsRead());
}
-// Tests that loading a distilled version of an entry.
+// Tests that loading an online version of a pending entry on reload does update
+// committed entry, reload, and mark entry read.
TEST_F(ReadingListWebStateObserverTest, TestLoadReadingListDistilledPending) {
GURL url(kTestURL);
std::string distilled_path = kTestDistilledPath;
- reading_list_model_->SetEntryDistilledPath(url,
- base::FilePath(distilled_path));
+ reading_list_model_->SetEntryDistilledInfo(
+ url, base::FilePath(distilled_path), GURL(kTestDistilledURL));
const ReadingListEntry* entry = reading_list_model_->GetEntryByURL(url);
GURL distilled_url =
reading_list::DistilledURLForPath(entry->DistilledPath(), entry->URL());
« no previous file with comments | « ios/chrome/browser/reading_list/reading_list_download_service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698