Lines Matching refs:Resource
186 const ClientMalwareReportRequest::Resource* lhs,
187 const ClientMalwareReportRequest::Resource* rhs) {
204 void InitResource(SafeBrowsingService::UnsafeResource* resource,
207 resource->client = NULL;
208 resource->url = url;
209 resource->resource_type = resource_type;
210 resource->threat_type = SafeBrowsingService::URL_MALWARE;
211 resource->render_process_host_id = contents()->GetRenderProcessHost()->id();
212 resource->render_view_id = contents()->render_view_host()->routing_id();
223 std::vector<const ClientMalwareReportRequest::Resource*> resources;
225 const ClientMalwareReportRequest::Resource& resource =
227 resources.push_back(&resource);
232 std::vector<const ClientMalwareReportRequest::Resource*> expected;
234 const ClientMalwareReportRequest::Resource& resource =
236 expected.push_back(&resource);
248 void VerifyResource(const ClientMalwareReportRequest::Resource* resource,
249 const ClientMalwareReportRequest::Resource* expected) {
250 EXPECT_EQ(expected->id(), resource->id());
251 EXPECT_EQ(expected->url(), resource->url());
252 EXPECT_EQ(expected->parent_id(), resource->parent_id());
253 ASSERT_EQ(expected->child_ids_size(), resource->child_ids_size());
255 EXPECT_EQ(expected->child_ids(i), resource->child_ids(i));
260 ASSERT_TRUE(resource->has_response());
262 resource->response().firstline().code());
265 resource->response().headers_size());
268 resource->response().headers(i).name());
270 resource->response().headers(i).value());
273 EXPECT_EQ(expected->response().body(), resource->response().body());
275 resource->response().bodylength());
277 resource->response().bodydigest());
291 SafeBrowsingService::UnsafeResource resource;
292 InitResource(&resource, ResourceType::SUB_RESOURCE, GURL(kMalwareURL));
295 sb_service_, contents(), resource, NULL);
307 ClientMalwareReportRequest::Resource* pb_resource = expected.add_resources();
322 SafeBrowsingService::UnsafeResource resource;
323 InitResource(&resource, ResourceType::SUB_RESOURCE, GURL(kMalwareURL));
324 resource.original_url = GURL(kOriginalLandingURL);
327 sb_service_.get(), contents(), resource, NULL);
339 ClientMalwareReportRequest::Resource* pb_resource = expected.add_resources();
350 // The Resource for kMmalwareUrl should have the Resource for
361 SafeBrowsingService::UnsafeResource resource;
362 InitResource(&resource, ResourceType::SUB_RESOURCE, GURL(kMalwareURL));
365 sb_service_.get(), contents(), resource, NULL);
391 ClientMalwareReportRequest::Resource* pb_resource = expected.add_resources();
416 SafeBrowsingService::UnsafeResource resource;
417 InitResource(&resource, ResourceType::SUB_RESOURCE, GURL(kMalwareURL));
419 sb_service_.get(), contents(), resource, NULL);
429 ClientMalwareReportRequest::Resource* pb_resource = expected.add_resources();
430 pb_resource->set_url(kMalwareURL); // Only one resource
436 // resource url
440 SafeBrowsingService::UnsafeResource resource;
441 InitResource(&resource, ResourceType::SUB_RESOURCE, GURL(kMalwareURL));
442 resource.original_url = GURL(kOriginalLandingURL);
445 resource.redirect_urls.push_back(GURL(kFirstRedirectURL));
446 resource.redirect_urls.push_back(GURL(kSecondRedirectURL));
447 resource.redirect_urls.push_back(GURL(kMalwareURL));
450 sb_service_.get(), contents(), resource, NULL);
461 ClientMalwareReportRequest::Resource* pb_resource = expected.add_resources();
491 SafeBrowsingService::UnsafeResource resource;
492 InitResource(&resource, ResourceType::SUB_RESOURCE, GURL(kMalwareURL));
496 sb_service_.get(), contents(), resource
518 ClientMalwareReportRequest::Resource* pb_resource = expected.add_resources();
558 SafeBrowsingService::UnsafeResource resource;
559 InitResource(&resource, ResourceType::SUB_RESOURCE, GURL(kMalwareURL));
563 sb_service_.get(), contents(), resource,
585 ClientMalwareReportRequest::Resource* pb_resource = expected.add_resources();