| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |