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

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

Issue 9838009: Clean up a few TODO items. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Respond to review comments. Created 8 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "chrome/browser/safe_browsing/browser_feature_extractor.h" 5 #include "chrome/browser/safe_browsing/browser_feature_extractor.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 // allows us to specify the referrer and page_transition_type. 93 // allows us to specify the referrer and page_transition_type.
94 void NavigateAndCommit(const GURL& url, 94 void NavigateAndCommit(const GURL& url,
95 const GURL& referrer, 95 const GURL& referrer,
96 content::PageTransition type) { 96 content::PageTransition type) {
97 contents()->GetController().LoadURL( 97 contents()->GetController().LoadURL(
98 url, content::Referrer(referrer, WebKit::WebReferrerPolicyDefault), 98 url, content::Referrer(referrer, WebKit::WebReferrerPolicyDefault),
99 type, std::string()); 99 type, std::string());
100 100
101 static int page_id = 0; 101 static int page_id = 0;
102 content::RenderViewHost* rvh = 102 content::RenderViewHost* rvh =
103 WebContentsTester::For(contents())->pending_rvh(); 103 WebContentsTester::For(contents())->GetPendingRenderViewHost();
104 if (!rvh) { 104 if (!rvh) {
105 rvh = contents()->GetRenderViewHost(); 105 rvh = contents()->GetRenderViewHost();
106 } 106 }
107 WebContentsTester::For(contents())->ProceedWithCrossSiteNavigation(); 107 WebContentsTester::For(contents())->ProceedWithCrossSiteNavigation();
108 WebContentsTester::For(contents())->TestDidNavigateWithReferrer( 108 WebContentsTester::For(contents())->TestDidNavigateWithReferrer(
109 rvh, ++page_id, url, 109 rvh, ++page_id, url,
110 content::Referrer(referrer, WebKit::WebReferrerPolicyDefault), type); 110 content::Referrer(referrer, WebKit::WebReferrerPolicyDefault), type);
111 } 111 }
112 112
113 bool ExtractFeatures(ClientPhishingRequest* request) { 113 bool ExtractFeatures(ClientPhishingRequest* request) {
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
499 EXPECT_TRUE(features.count(StringPrintf("%s%s", 499 EXPECT_TRUE(features.count(StringPrintf("%s%s",
500 features::kSafeBrowsingMaliciousUrl, 500 features::kSafeBrowsingMaliciousUrl,
501 "http://www.malware.com/"))); 501 "http://www.malware.com/")));
502 EXPECT_TRUE(features.count(StringPrintf("%s%s", 502 EXPECT_TRUE(features.count(StringPrintf("%s%s",
503 features::kSafeBrowsingOriginalUrl, 503 features::kSafeBrowsingOriginalUrl,
504 "http://www.good.com/"))); 504 "http://www.good.com/")));
505 EXPECT_DOUBLE_EQ(1.0, features[features::kSafeBrowsingIsSubresource]); 505 EXPECT_DOUBLE_EQ(1.0, features[features::kSafeBrowsingIsSubresource]);
506 EXPECT_DOUBLE_EQ(2.0, features[features::kSafeBrowsingThreatType]); 506 EXPECT_DOUBLE_EQ(2.0, features[features::kSafeBrowsingThreatType]);
507 } 507 }
508 } // namespace safe_browsing 508 } // namespace safe_browsing
OLDNEW
« no previous file with comments | « chrome/browser/autofill/autofill_browsertest.cc ('k') | chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698