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

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

Issue 8437002: Move BrowserThread to content namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: A few updates. 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 static const char* kMalwareData = "exploit();"; 45 static const char* kMalwareData = "exploit();";
46 46
47 static const char* kLandingURL = "http://www.landingpage.com/"; 47 static const char* kLandingURL = "http://www.landingpage.com/";
48 static const char* kLandingHeaders = 48 static const char* kLandingHeaders =
49 "HTTP/1.1 200 OK\n" 49 "HTTP/1.1 200 OK\n"
50 "Content-Type: text/html\n" 50 "Content-Type: text/html\n"
51 "Content-Length: 1024\n" 51 "Content-Length: 1024\n"
52 "Set-Cookie: tastycookie\n"; // This header is stripped. 52 "Set-Cookie: tastycookie\n"; // This header is stripped.
53 static const char* kLandingData = "<iframe src='http://www.malware.com'>"; 53 static const char* kLandingData = "<iframe src='http://www.malware.com'>";
54 54
55 using content::BrowserThread;
55 using safe_browsing::ClientMalwareReportRequest; 56 using safe_browsing::ClientMalwareReportRequest;
56 57
57 namespace { 58 namespace {
58 59
59 void WriteHeaders(disk_cache::Entry* entry, const std::string headers) { 60 void WriteHeaders(disk_cache::Entry* entry, const std::string headers) {
60 net::HttpResponseInfo responseinfo; 61 net::HttpResponseInfo responseinfo;
61 std::string raw_headers = net::HttpUtil::AssembleRawHeaders( 62 std::string raw_headers = net::HttpUtil::AssembleRawHeaders(
62 headers.c_str(), headers.size()); 63 headers.c_str(), headers.size());
63 responseinfo.socket_address = net::HostPortPair("1.2.3.4", 80); 64 responseinfo.socket_address = net::HostPortPair("1.2.3.4", 80);
64 responseinfo.headers = new net::HttpResponseHeaders(raw_headers); 65 responseinfo.headers = new net::HttpResponseHeaders(raw_headers);
(...skipping 613 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
« no previous file with comments | « chrome/browser/safe_browsing/malware_details_history.cc ('k') | chrome/browser/safe_browsing/protocol_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698