| Index: chrome/renderer/safe_browsing/phishing_dom_feature_extractor_browsertest.cc
|
| diff --git a/chrome/renderer/safe_browsing/phishing_dom_feature_extractor_browsertest.cc b/chrome/renderer/safe_browsing/phishing_dom_feature_extractor_browsertest.cc
|
| index e8e1b18e7d15c8bbeff35e881b6d35a1179403bc..6c3644175b1c3bca6a85d206649e7ddf7a717674 100644
|
| --- a/chrome/renderer/safe_browsing/phishing_dom_feature_extractor_browsertest.cc
|
| +++ b/chrome/renderer/safe_browsing/phishing_dom_feature_extractor_browsertest.cc
|
| @@ -134,11 +134,11 @@ class PhishingDOMFeatureExtractorTest : public InProcessBrowserTest {
|
|
|
| bool StartTestServer() {
|
| CHECK(!embedded_test_server_);
|
| - embedded_test_server_.reset(new net::test_server::EmbeddedTestServer());
|
| + embedded_test_server_.reset(new net::EmbeddedTestServer());
|
| embedded_test_server_->RegisterRequestHandler(
|
| base::Bind(&PhishingDOMFeatureExtractorTest::HandleRequest,
|
| base::Unretained(this)));
|
| - return embedded_test_server_->InitializeAndWaitUntilReady();
|
| + return embedded_test_server_->Start();
|
| }
|
|
|
| scoped_ptr<net::test_server::HttpResponse> HandleRequest(
|
| @@ -184,7 +184,7 @@ class PhishingDOMFeatureExtractorTest : public InProcessBrowserTest {
|
| // Any urls not in this map are served a 404 error.
|
| std::map<std::string, std::string> responses_;
|
|
|
| - scoped_ptr<net::test_server::EmbeddedTestServer> embedded_test_server_;
|
| + scoped_ptr<net::EmbeddedTestServer> embedded_test_server_;
|
| MockFeatureExtractorClock clock_;
|
| scoped_ptr<PhishingDOMFeatureExtractor> extractor_;
|
| bool success_; // holds the success value from ExtractFeatures
|
| @@ -281,17 +281,15 @@ IN_PROC_BROWSER_TEST_F(PhishingDOMFeatureExtractorTest, LinkFeatures) {
|
| expected_features.AddBooleanFeature(features::kPageLinkDomain +
|
| std::string("chromium.org"));
|
|
|
| - net::SpawnedTestServer https_server(
|
| - net::SpawnedTestServer::TYPE_HTTPS,
|
| - net::SpawnedTestServer::kLocalhost,
|
| - base::FilePath(FILE_PATH_LITERAL("chrome/test/data")));
|
| + net::EmbeddedTestServer https_server(net::EmbeddedTestServer::TYPE_HTTPS);
|
| + https_server.ServeFilesFromSourceDirectory("chrome/test/data");
|
| ASSERT_TRUE(https_server.Start());
|
|
|
| // The PhishingDOMFeatureExtractor depends on URLs being domains and not IPs,
|
| // so use a domain.
|
| std::string url_str = "https://host.com:";
|
| url_str += base::UintToString(https_server.host_port_pair().port());
|
| - url_str += "/files/safe_browsing/secure_link_features.html";
|
| + url_str += "/safe_browsing/secure_link_features.html";
|
| ui_test_utils::NavigateToURL(browser(), GURL(url_str));
|
|
|
| // Click through the certificate error interstitial.
|
| @@ -332,17 +330,15 @@ IN_PROC_BROWSER_TEST_F(PhishingDOMFeatureExtractorTest,
|
| expected_features.AddRealFeature(features::kPageImgOtherDomainFreq, 0.5);
|
|
|
| features.Clear();
|
| - net::SpawnedTestServer https_server(
|
| - net::SpawnedTestServer::TYPE_HTTPS,
|
| - net::SpawnedTestServer::kLocalhost,
|
| - base::FilePath(FILE_PATH_LITERAL("chrome/test/data")));
|
| + net::EmbeddedTestServer https_server(net::EmbeddedTestServer::TYPE_HTTPS);
|
| + https_server.ServeFilesFromSourceDirectory("chrome/test/data");
|
| ASSERT_TRUE(https_server.Start());
|
|
|
| // The PhishingDOMFeatureExtractor depends on URLs being domains and not IPs,
|
| // so use a domain.
|
| std::string url_str = "https://host.com:";
|
| url_str += base::UintToString(https_server.host_port_pair().port());
|
| - url_str += "/files/safe_browsing/secure_script_and_image.html";
|
| + url_str += "/safe_browsing/secure_script_and_image.html";
|
| ui_test_utils::NavigateToURL(browser(), GURL(url_str));
|
|
|
| // Click through the certificate error interstitial.
|
|
|