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

Unified Diff: chrome/browser/android/offline_pages/offline_page_utils_unittest.cc

Issue 2023293002: OfflinePageModel cleanups - improved CanSavePage() and moved static kInvalidOfflineId to impl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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: chrome/browser/android/offline_pages/offline_page_utils_unittest.cc
diff --git a/chrome/browser/android/offline_pages/offline_page_utils_unittest.cc b/chrome/browser/android/offline_pages/offline_page_utils_unittest.cc
index 4069d1ce2e561b1d3914670c574ba75c6f10f559..55332719b3a3aa76023753ce4e65e453688318f2 100644
--- a/chrome/browser/android/offline_pages/offline_page_utils_unittest.cc
+++ b/chrome/browser/android/offline_pages/offline_page_utils_unittest.cc
@@ -176,6 +176,16 @@ std::unique_ptr<OfflinePageTestArchiver> OfflinePageUtilsTest::BuildArchiver(
return archiver;
}
+TEST_F(OfflinePageUtilsTest, CanSaveURL) {
+ EXPECT_TRUE(OfflinePageUtils::CanSaveURL(GURL("http://foo")));
+ EXPECT_TRUE(OfflinePageUtils::CanSaveURL(GURL("https://foo")));
+ EXPECT_FALSE(OfflinePageUtils::CanSaveURL(GURL("file:///foo")));
+ EXPECT_FALSE(OfflinePageUtils::CanSaveURL(GURL("data:image/png;base64,ab")));
+ EXPECT_FALSE(OfflinePageUtils::CanSaveURL(GURL("chrome://version")));
+ EXPECT_FALSE(OfflinePageUtils::CanSaveURL(GURL("chrome-native://newtab/")));
+ EXPECT_FALSE(OfflinePageUtils::CanSaveURL(GURL("/invalid/url.mhtml")));
+}
+
TEST_F(OfflinePageUtilsTest, MightBeOfflineURL) {
// URL is invalid.
EXPECT_FALSE(OfflinePageUtils::MightBeOfflineURL(GURL("/test.mhtml")));

Powered by Google App Engine
This is Rietveld 408576698