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

Side by Side Diff: chrome/renderer/safe_browsing/phishing_dom_feature_extractor_browsertest.cc

Issue 657313003: Use scoped_ptr::Pass instead of scoped_ptr::PassAs<T>. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
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 // Note that although this is not a "browser" test, it runs as part of 5 // Note that although this is not a "browser" test, it runs as part of
6 // browser_tests. This is because WebKit does not work properly if it is 6 // browser_tests. This is because WebKit does not work properly if it is
7 // shutdown and re-initialized. Since browser_tests runs each test in a 7 // shutdown and re-initialized. Since browser_tests runs each test in a
8 // new process, this avoids the problem. 8 // new process, this avoids the problem.
9 9
10 #include "chrome/renderer/safe_browsing/phishing_dom_feature_extractor.h" 10 #include "chrome/renderer/safe_browsing/phishing_dom_feature_extractor.h"
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 std::map<std::string, std::string>::const_iterator it = 151 std::map<std::string, std::string>::const_iterator it =
152 responses_.find(url); 152 responses_.find(url);
153 if (it == responses_.end()) 153 if (it == responses_.end())
154 return scoped_ptr<net::test_server::HttpResponse>(); 154 return scoped_ptr<net::test_server::HttpResponse>();
155 155
156 scoped_ptr<net::test_server::BasicHttpResponse> http_response( 156 scoped_ptr<net::test_server::BasicHttpResponse> http_response(
157 new net::test_server::BasicHttpResponse()); 157 new net::test_server::BasicHttpResponse());
158 http_response->set_code(net::HTTP_OK); 158 http_response->set_code(net::HTTP_OK);
159 http_response->set_content_type("text/html"); 159 http_response->set_content_type("text/html");
160 http_response->set_content(it->second); 160 http_response->set_content(it->second);
161 return http_response.PassAs<net::test_server::HttpResponse>(); 161 return http_response.Pass();
162 } 162 }
163 163
164 GURL GetURL(const std::string& host, const std::string& path) { 164 GURL GetURL(const std::string& host, const std::string& path) {
165 GURL::Replacements replace; 165 GURL::Replacements replace;
166 replace.SetHostStr(host); 166 replace.SetHostStr(host);
167 replace.SetPathStr(path); 167 replace.SetPathStr(path);
168 return embedded_test_server_->base_url().ReplaceComponents(replace); 168 return embedded_test_server_->base_url().ReplaceComponents(replace);
169 } 169 }
170 170
171 // Returns the URL that was loaded. 171 // Returns the URL that was loaded.
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 LoadHtml( 514 LoadHtml(
515 "host.com", 515 "host.com",
516 "<html><head></head><body>" 516 "<html><head></head><body>"
517 "<iframe src=\"frame.html\" id=\"frame1\"></iframe>" 517 "<iframe src=\"frame.html\" id=\"frame1\"></iframe>"
518 "<form></form></body></html>"); 518 "<form></form></body></html>");
519 ASSERT_TRUE(ExtractFeatures(&features)); 519 ASSERT_TRUE(ExtractFeatures(&features));
520 ExpectFeatureMapsAreEqual(features, expected_features); 520 ExpectFeatureMapsAreEqual(features, expected_features);
521 } 521 }
522 522
523 } // namespace safe_browsing 523 } // namespace safe_browsing
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698