OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <algorithm> | 5 #include <algorithm> |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/pickle.h" | 8 #include "base/pickle.h" |
9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 base::Bind(&MalwareDetails::FinishCollection, report)); | 208 base::Bind(&MalwareDetails::FinishCollection, report)); |
209 // Wait for the callback (SendSerializedMalwareDetails). | 209 // Wait for the callback (SendSerializedMalwareDetails). |
210 DVLOG(1) << "Waiting for SendSerializedMalwareDetails"; | 210 DVLOG(1) << "Waiting for SendSerializedMalwareDetails"; |
211 base::RunLoop run_loop; | 211 base::RunLoop run_loop; |
212 ui_manager_->SetRunLoopToQuit(&run_loop); | 212 ui_manager_->SetRunLoopToQuit(&run_loop); |
213 run_loop.Run(); | 213 run_loop.Run(); |
214 return ui_manager_->GetSerialized(); | 214 return ui_manager_->GetSerialized(); |
215 } | 215 } |
216 | 216 |
217 HistoryService* history_service() { | 217 HistoryService* history_service() { |
218 return HistoryServiceFactory::GetForProfile(profile(), | 218 return HistoryServiceFactory::GetForProfile( |
219 Profile::EXPLICIT_ACCESS); | 219 profile(), ServiceAccessType::EXPLICIT_ACCESS); |
220 } | 220 } |
221 | 221 |
222 protected: | 222 protected: |
223 void InitResource(UnsafeResource* resource, | 223 void InitResource(UnsafeResource* resource, |
224 bool is_subresource, | 224 bool is_subresource, |
225 const GURL& url) { | 225 const GURL& url) { |
226 resource->url = url; | 226 resource->url = url; |
227 resource->is_subresource = is_subresource; | 227 resource->is_subresource = is_subresource; |
228 resource->threat_type = SB_THREAT_TYPE_URL_MALWARE; | 228 resource->threat_type = SB_THREAT_TYPE_URL_MALWARE; |
229 resource->render_process_host_id = | 229 resource->render_process_host_id = |
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
683 pb_resource = expected.add_resources(); | 683 pb_resource = expected.add_resources(); |
684 pb_resource->set_id(2); | 684 pb_resource->set_id(2); |
685 pb_resource->set_parent_id(3); | 685 pb_resource->set_parent_id(3); |
686 pb_resource->set_url(kSecondRedirectURL); | 686 pb_resource->set_url(kSecondRedirectURL); |
687 pb_resource = expected.add_resources(); | 687 pb_resource = expected.add_resources(); |
688 pb_resource->set_id(3); | 688 pb_resource->set_id(3); |
689 pb_resource->set_url(kFirstRedirectURL); | 689 pb_resource->set_url(kFirstRedirectURL); |
690 | 690 |
691 VerifyResults(actual, expected); | 691 VerifyResults(actual, expected); |
692 } | 692 } |
OLD | NEW |