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

Unified Diff: chrome/browser/safe_browsing/malware_details_unittest.cc

Issue 6880285: SafeBrowsing Opt-in Malware Reports: Collect remote ip:port pairs for requests that were not fetc... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/safe_browsing/malware_details_cache.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/safe_browsing/malware_details_unittest.cc
===================================================================
--- chrome/browser/safe_browsing/malware_details_unittest.cc (revision 84780)
+++ chrome/browser/safe_browsing/malware_details_unittest.cc (working copy)
@@ -56,6 +56,7 @@
net::HttpResponseInfo responseinfo;
std::string raw_headers = net::HttpUtil::AssembleRawHeaders(
headers.c_str(), headers.size());
+ responseinfo.socket_address = net::HostPortPair("1.2.3.4", 80);
responseinfo.headers = new net::HttpResponseHeaders(raw_headers);
Pickle pickle;
@@ -96,7 +97,6 @@
WriteHeaders(entry, headers);
WriteData(entry, data);
-
entry->Close();
}
@@ -276,6 +276,10 @@
EXPECT_EQ(expected->response().bodydigest(),
resource->response().bodydigest());
}
+
+ // Verify IP:port pair
+ EXPECT_EQ(expected->response().remote_ip(),
+ resource->response().remote_ip());
}
BrowserThread ui_thread_;
@@ -534,6 +538,7 @@
pb_response->set_body(kLandingData);
pb_response->set_bodylength(37);
pb_response->set_bodydigest("9ca97475598a79bc1e8fc9bd6c72cd35");
+ pb_response->set_remote_ip("1.2.3.4:80");
pb_resource = expected.add_resources();
pb_resource->set_id(1);
@@ -546,6 +551,7 @@
pb_response->set_body(kMalwareData);
pb_response->set_bodylength(10);
pb_response->set_bodydigest("581373551c43d4cf33bfb3b26838ff95");
+ pb_response->set_remote_ip("1.2.3.4:80");
expected.set_complete(true);
VerifyResults(actual, expected);
« no previous file with comments | « chrome/browser/safe_browsing/malware_details_cache.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698