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

Unified Diff: components/update_client/ping_manager_unittest.cc

Issue 1740333002: Allow fallback from https to http for component update checks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 | « components/update_client/ping_manager.cc ('k') | components/update_client/request_sender.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/update_client/ping_manager_unittest.cc
diff --git a/components/update_client/ping_manager_unittest.cc b/components/update_client/ping_manager_unittest.cc
index cf1d147cd286c3aee6ebac5fc15f2569ac72cdb5..e25dc94533a4d83acb144d1fe698685f4c304125 100644
--- a/components/update_client/ping_manager_unittest.cc
+++ b/components/update_client/ping_manager_unittest.cc
@@ -177,4 +177,23 @@ TEST_F(ComponentUpdaterPingManagerTest, DISABLED_PingManagerTest) {
interceptor->Reset();
}
+// Tests that sending the ping fails when the component requires encryption but
+// the ping URL is unsecure.
+TEST_F(ComponentUpdaterPingManagerTest, PingManagerRequiresEncryptionTest) {
+ config_->SetPingUrl(GURL("http:\\foo\bar"));
+
+ {
+ CrxUpdateItem item;
+ item.component.requires_network_encryption = true;
+
+ EXPECT_FALSE(ping_manager_->SendPing(&item));
+ }
+
+ {
+ // Tests that the default for |requires_network_encryption| is true.
+ CrxUpdateItem item;
+ EXPECT_FALSE(ping_manager_->SendPing(&item));
+ }
+}
+
} // namespace update_client
« no previous file with comments | « components/update_client/ping_manager.cc ('k') | components/update_client/request_sender.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698