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

Unified Diff: chrome/browser/installable/installable_manager_browsertest.cc

Issue 2751343002: Adds a basic offline check to InstallableManager. (Closed)
Patch Set: Rebase Created 3 years, 9 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/installable/installable_manager_browsertest.cc
diff --git a/chrome/browser/installable/installable_manager_browsertest.cc b/chrome/browser/installable/installable_manager_browsertest.cc
index fa43b1a707d726a47fdeb8411eb1a8d8d86702d1..f809328ae86c428a862ed8959fa9726de9451997 100644
--- a/chrome/browser/installable/installable_manager_browsertest.cc
+++ b/chrome/browser/installable/installable_manager_browsertest.cc
@@ -620,6 +620,30 @@ IN_PROC_BROWSER_TEST_F(InstallableManagerBrowserTest,
}
}
+IN_PROC_BROWSER_TEST_F(InstallableManagerBrowserTest,
+ CheckPageWithNoServiceWorkerFetchHandler) {
+ base::RunLoop run_loop;
+ std::unique_ptr<CallbackTester> tester(
+ new CallbackTester(run_loop.QuitClosure()));
+
+ NavigateAndRunInstallableManager(
+ tester.get(), GetWebAppParams(),
+ "/banners/no_sw_fetch_handler_test_page.html");
+
+ RunInstallableManager(tester.get(), GetWebAppParams());
+ run_loop.Run();
+
+ EXPECT_FALSE(tester->manifest().IsEmpty());
+ EXPECT_FALSE(tester->manifest_url().is_empty());
+
+ EXPECT_TRUE(tester->primary_icon_url().is_empty());
+ EXPECT_EQ(nullptr, tester->primary_icon());
+ EXPECT_TRUE(tester->badge_icon_url().is_empty());
+ EXPECT_EQ(nullptr, tester->badge_icon());
+ EXPECT_FALSE(tester->is_installable());
+ EXPECT_EQ(NOT_OFFLINE_CAPABLE, tester->error_code());
+}
+
IN_PROC_BROWSER_TEST_F(InstallableManagerBrowserTest, CheckDataUrlIcon) {
// Verify that InstallableManager can handle data URL icons.
base::RunLoop run_loop;
« no previous file with comments | « chrome/browser/installable/installable_manager.cc ('k') | chrome/test/data/banners/no_sw_fetch_handler_test_page.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698