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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <string> 5 #include <string>
6 6
7 #include "base/memory/ref_counted.h" 7 #include "base/memory/ref_counted.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "base/thread_task_runner_handle.h" 10 #include "base/thread_task_runner_handle.h"
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 "<event eventtype=\"14\" eventresult=\"0\" downloader=\"direct\" " 170 "<event eventtype=\"14\" eventresult=\"0\" downloader=\"direct\" "
171 "errorcode=\"-1\" url=\"http://host1/path1\" downloaded=\"123\" " 171 "errorcode=\"-1\" url=\"http://host1/path1\" downloaded=\"123\" "
172 "total=\"456\" download_time_ms=\"987\"/>" 172 "total=\"456\" download_time_ms=\"987\"/>"
173 "<event eventtype=\"14\" eventresult=\"1\" downloader=\"bits\" " 173 "<event eventtype=\"14\" eventresult=\"1\" downloader=\"bits\" "
174 "url=\"http://host2/path2\" downloaded=\"1230\" total=\"4560\" " 174 "url=\"http://host2/path2\" downloaded=\"1230\" total=\"4560\" "
175 "download_time_ms=\"9870\"/></app>")) 175 "download_time_ms=\"9870\"/></app>"))
176 << interceptor->GetRequestsAsString(); 176 << interceptor->GetRequestsAsString();
177 interceptor->Reset(); 177 interceptor->Reset();
178 } 178 }
179 179
180 // Tests that sending the ping fails when the component requires encryption but
181 // the ping URL is unsecure.
182 TEST_F(ComponentUpdaterPingManagerTest, PingManagerRequiresEncryptionTest) {
183 config_->SetPingUrl(GURL("http:\\foo\bar"));
184
185 {
186 CrxUpdateItem item;
187 item.component.requires_network_encryption = true;
188
189 EXPECT_FALSE(ping_manager_->SendPing(&item));
190 }
191
192 {
193 // Tests that the default for |requires_network_encryption| is true.
194 CrxUpdateItem item;
195 EXPECT_FALSE(ping_manager_->SendPing(&item));
196 }
197 }
198
180 } // namespace update_client 199 } // namespace update_client
OLDNEW
« 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