Index: net/proxy/proxy_resolver_perftest.cc |
diff --git a/net/proxy/proxy_resolver_perftest.cc b/net/proxy/proxy_resolver_perftest.cc |
index 6b0b68fb71b14fb23327ff89e45ca4be63c59df3..634f6704090175d1f1c1907ff79f9fe48ad341ca 100644 |
--- a/net/proxy/proxy_resolver_perftest.cc |
+++ b/net/proxy/proxy_resolver_perftest.cc |
@@ -43,11 +43,12 @@ struct PacPerfTest { |
// List of performance tests. |
static PacPerfTest kPerfTests[] = { |
- // This test uses an ad-blocker PAC script. This script is very heavily |
- // regular expression oriented, and has no dependencies on the current |
- // IP address, or DNS resolving of hosts. |
- { "no-ads.pac", |
- { // queries: |
+ // This test uses an ad-blocker PAC script. This script is very heavily |
+ // regular expression oriented, and has no dependencies on the current |
+ // IP address, or DNS resolving of hosts. |
+ { |
+ "no-ads.pac", |
+ {// queries: |
{"http://www.google.com", "DIRECT"}, |
{"http://www.imdb.com/photos/cmsicons/x", "PROXY 0.0.0.0:3421"}, |
{"http://www.imdb.com/x", "DIRECT"}, |
@@ -59,9 +60,8 @@ static PacPerfTest kPerfTests[] = { |
{"http://www.testurl1.com/index.html", "DIRECT"}, |
{"http://www.testurl2.com", "DIRECT"}, |
{"https://www.sample/pirate/arrrrrr", "DIRECT"}, |
- {NULL, NULL} |
+ {NULL, NULL}}, |
}, |
- }, |
}; |
int PacPerfTest::NumQueries() const { |
@@ -85,20 +85,16 @@ class PacPerfSuiteRunner { |
const std::string& resolver_name) |
: resolver_(resolver), |
resolver_name_(resolver_name), |
- test_server_( |
- net::SpawnedTestServer::TYPE_HTTP, |
- net::SpawnedTestServer::kLocalhost, |
- base::FilePath( |
- FILE_PATH_LITERAL("net/data/proxy_resolver_perftest"))) { |
- } |
+ test_server_(net::SpawnedTestServer::TYPE_HTTP, |
+ net::SpawnedTestServer::kLocalhost, |
+ base::FilePath(FILE_PATH_LITERAL( |
+ "net/data/proxy_resolver_perftest"))) {} |
void RunAllTests() { |
ASSERT_TRUE(test_server_.Start()); |
for (size_t i = 0; i < arraysize(kPerfTests); ++i) { |
const PacPerfTest& test_data = kPerfTests[i]; |
- RunTest(test_data.pac_name, |
- test_data.queries, |
- test_data.NumQueries()); |
+ RunTest(test_data.pac_name, test_data.queries, test_data.NumQueries()); |
} |
} |
@@ -107,8 +103,7 @@ class PacPerfSuiteRunner { |
const PacQuery* queries, |
int queries_len) { |
if (!resolver_->expects_pac_bytes()) { |
- GURL pac_url = |
- test_server_.GetURL(std::string("files/") + script_name); |
+ GURL pac_url = test_server_.GetURL(std::string("files/") + script_name); |
int rv = resolver_->SetPacScript( |
net::ProxyResolverScriptData::FromURL(pac_url), |
net::CompletionCallback()); |
@@ -122,9 +117,11 @@ class PacPerfSuiteRunner { |
// the PAC script. |
{ |
net::ProxyInfo proxy_info; |
- int result = resolver_->GetProxyForURL( |
- GURL("http://www.warmup.com"), &proxy_info, net::CompletionCallback(), |
- NULL, net::BoundNetLog()); |
+ int result = resolver_->GetProxyForURL(GURL("http://www.warmup.com"), |
+ &proxy_info, |
+ net::CompletionCallback(), |
+ NULL, |
+ net::BoundNetLog()); |
ASSERT_EQ(net::OK, result); |
} |
@@ -138,9 +135,11 @@ class PacPerfSuiteRunner { |
// Resolve. |
net::ProxyInfo proxy_info; |
- int result = resolver_->GetProxyForURL( |
- GURL(query.query_url), &proxy_info, net::CompletionCallback(), NULL, |
- net::BoundNetLog()); |
+ int result = resolver_->GetProxyForURL(GURL(query.query_url), |
+ &proxy_info, |
+ net::CompletionCallback(), |
+ NULL, |
+ net::BoundNetLog()); |
// Check that the result was correct. Note that ToPacString() and |
// ASSERT_EQ() are fast, so they won't skew the results. |
@@ -199,9 +198,7 @@ class MockJSBindings : public net::ProxyResolverV8::JSBindings { |
public: |
MockJSBindings() {} |
- virtual void Alert(const base::string16& message) OVERRIDE { |
- CHECK(false); |
- } |
+ virtual void Alert(const base::string16& message) OVERRIDE { CHECK(false); } |
virtual bool ResolveDns(const std::string& host, |
ResolveDnsOperation op, |