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

Side by Side Diff: chrome/browser/safe_browsing/malware_details_unittest.cc

Issue 8515027: Define the public version of the browser side RenderProcessHost interface. This interface is not ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/time.h" 9 #include "base/time.h"
10 #include "chrome/browser/history/history.h" 10 #include "chrome/browser/history/history.h"
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 } 210 }
211 211
212 protected: 212 protected:
213 void InitResource(SafeBrowsingService::UnsafeResource* resource, 213 void InitResource(SafeBrowsingService::UnsafeResource* resource,
214 bool is_subresource, 214 bool is_subresource,
215 const GURL& url) { 215 const GURL& url) {
216 resource->client = NULL; 216 resource->client = NULL;
217 resource->url = url; 217 resource->url = url;
218 resource->is_subresource = is_subresource; 218 resource->is_subresource = is_subresource;
219 resource->threat_type = SafeBrowsingService::URL_MALWARE; 219 resource->threat_type = SafeBrowsingService::URL_MALWARE;
220 resource->render_process_host_id = contents()->GetRenderProcessHost()->id(); 220 resource->render_process_host_id = contents()->GetRenderProcessHost()->
221 GetID();
221 resource->render_view_id = contents()->render_view_host()->routing_id(); 222 resource->render_view_id = contents()->render_view_host()->routing_id();
222 } 223 }
223 224
224 void VerifyResults(const ClientMalwareReportRequest& report_pb, 225 void VerifyResults(const ClientMalwareReportRequest& report_pb,
225 const ClientMalwareReportRequest& expected_pb) { 226 const ClientMalwareReportRequest& expected_pb) {
226 EXPECT_EQ(expected_pb.malware_url(), report_pb.malware_url()); 227 EXPECT_EQ(expected_pb.malware_url(), report_pb.malware_url());
227 EXPECT_EQ(expected_pb.page_url(), report_pb.page_url()); 228 EXPECT_EQ(expected_pb.page_url(), report_pb.page_url());
228 EXPECT_EQ(expected_pb.referrer_url(), report_pb.referrer_url()); 229 EXPECT_EQ(expected_pb.referrer_url(), report_pb.referrer_url());
229 230
230 ASSERT_EQ(expected_pb.resources_size(), report_pb.resources_size()); 231 ASSERT_EQ(expected_pb.resources_size(), report_pb.resources_size());
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after
678 pb_resource = expected.add_resources(); 679 pb_resource = expected.add_resources();
679 pb_resource->set_id(2); 680 pb_resource->set_id(2);
680 pb_resource->set_parent_id(3); 681 pb_resource->set_parent_id(3);
681 pb_resource->set_url(kSecondRedirectURL); 682 pb_resource->set_url(kSecondRedirectURL);
682 pb_resource = expected.add_resources(); 683 pb_resource = expected.add_resources();
683 pb_resource->set_id(3); 684 pb_resource->set_id(3);
684 pb_resource->set_url(kFirstRedirectURL); 685 pb_resource->set_url(kFirstRedirectURL);
685 686
686 VerifyResults(actual, expected); 687 VerifyResults(actual, expected);
687 } 688 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698