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

Unified Diff: ios/chrome/browser/ui/reading_list/offline_page_native_content_unittest.mm

Issue 2644293002: [Reading List iOS] Display distilled URL instead of entry URL in omnibox (Closed)
Patch Set: 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
Index: ios/chrome/browser/ui/reading_list/offline_page_native_content_unittest.mm
diff --git a/ios/chrome/browser/ui/reading_list/offline_page_native_content_unittest.mm b/ios/chrome/browser/ui/reading_list/offline_page_native_content_unittest.mm
index ae28f85c16550fb2c03eaaf4a8748878f5bf365e..f48d97184801d80baa0eb7fe8bb0ace4254aefd0 100644
--- a/ios/chrome/browser/ui/reading_list/offline_page_native_content_unittest.mm
+++ b/ios/chrome/browser/ui/reading_list/offline_page_native_content_unittest.mm
@@ -30,9 +30,10 @@ class OfflinePageNativeContentTest : public web::WebTestWithWebState {
gambard 2017/01/20 14:49:35 Maybe add a test for the restoreOnlineURL through
Olivier 2017/01/20 16:09:14 Done.
// Checks the OfflinePageNativeContent is correctly initialized.
TEST_F(OfflinePageNativeContentTest, BasicOfflinePageTest) {
- GURL foo_url("http://foo.bar");
- GURL url = reading_list::DistilledURLForPath(
- base::FilePath("offline_id/page.html"), foo_url);
+ GURL entry_url("http://foo.bar");
+ GURL distilled_url("http://foo.bar/distilled");
+ GURL url = reading_list::OfflineURLForPath(
+ base::FilePath("offline_id/page.html"), entry_url, distilled_url);
id<UrlLoader> loader = [OCMockObject mockForProtocol:@protocol(UrlLoader)];
base::scoped_nsobject<OfflinePageNativeContent> content(
[[OfflinePageNativeContent alloc]
@@ -41,13 +42,13 @@ TEST_F(OfflinePageNativeContentTest, BasicOfflinePageTest) {
webState:web_state()
URL:url]);
ASSERT_EQ(url, [content url]);
- ASSERT_EQ(foo_url, [content virtualURL]);
+ ASSERT_EQ(distilled_url, [content virtualURL]);
ASSERT_OCMOCK_VERIFY((OCMockObject*)loader);
}
TEST_F(OfflinePageNativeContentTest, BasicOfflinePageTestWithoutVirtualURL) {
gambard 2017/01/20 14:49:35 Add comments
Olivier 2017/01/20 16:09:14 Done.
- GURL url = reading_list::DistilledURLForPath(
- base::FilePath("offline_id/page.html"), GURL());
+ GURL url = reading_list::OfflineURLForPath(
+ base::FilePath("offline_id/page.html"), GURL(), GURL());
id<UrlLoader> loader = [OCMockObject mockForProtocol:@protocol(UrlLoader)];
base::scoped_nsobject<OfflinePageNativeContent> content(
[[OfflinePageNativeContent alloc]

Powered by Google App Engine
This is Rietveld 408576698