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

Unified Diff: net/proxy/proxy_resolver_v8_tracing_unittest.cc

Issue 266243004: Clang format slam. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: net/proxy/proxy_resolver_v8_tracing_unittest.cc
diff --git a/net/proxy/proxy_resolver_v8_tracing_unittest.cc b/net/proxy/proxy_resolver_v8_tracing_unittest.cc
index 5cad3a21b108a82550c7bc67ae80cf06651e3b36..4822ad2e79e2aae42b6bf76a59791211721e20de 100644
--- a/net/proxy/proxy_resolver_v8_tracing_unittest.cc
+++ b/net/proxy/proxy_resolver_v8_tracing_unittest.cc
@@ -74,7 +74,8 @@ class MockErrorObserver : public ProxyResolverErrorObserver {
const base::string16& error) OVERRIDE {
{
base::AutoLock l(lock_);
- output += base::StringPrintf("Error: line %d: %s\n", line_number,
+ output += base::StringPrintf("Error: line %d: %s\n",
+ line_number,
base::UTF16ToASCII(error).c_str());
}
event_.Signal();
@@ -85,9 +86,7 @@ class MockErrorObserver : public ProxyResolverErrorObserver {
return output;
}
- void WaitForOutput() {
- event_.Wait();
- }
+ void WaitForOutput() { event_.Wait(); }
private:
base::Lock lock_;
@@ -108,9 +107,11 @@ TEST_F(ProxyResolverV8TracingTest, Simple) {
TestCompletionCallback callback;
ProxyInfo proxy_info;
- int rv = resolver.GetProxyForURL(
- GURL("http://foo/"), &proxy_info, callback.callback(),
- NULL, request_log.bound());
+ int rv = resolver.GetProxyForURL(GURL("http://foo/"),
+ &proxy_info,
+ callback.callback(),
+ NULL,
+ request_log.bound());
EXPECT_EQ(ERR_IO_PENDING, rv);
EXPECT_EQ(OK, callback.WaitForResult());
@@ -139,17 +140,21 @@ TEST_F(ProxyResolverV8TracingTest, JavascriptError) {
TestCompletionCallback callback;
ProxyInfo proxy_info;
- int rv = resolver.GetProxyForURL(
- GURL("http://throw-an-error/"), &proxy_info, callback.callback(), NULL,
- request_log.bound());
+ int rv = resolver.GetProxyForURL(GURL("http://throw-an-error/"),
+ &proxy_info,
+ callback.callback(),
+ NULL,
+ request_log.bound());
EXPECT_EQ(ERR_IO_PENDING, rv);
EXPECT_EQ(ERR_PAC_SCRIPT_FAILED, callback.WaitForResult());
EXPECT_EQ(0u, host_resolver.num_resolve());
- EXPECT_EQ("Error: line 5: Uncaught TypeError: Cannot read property 'split' "
- "of null\n", error_observer->GetOutput());
+ EXPECT_EQ(
+ "Error: line 5: Uncaught TypeError: Cannot read property 'split' "
+ "of null\n",
+ error_observer->GetOutput());
// Check the NetLogs -- there was 1 alert and 1 javascript error, and they
// were output to both the global log, and per-request log.
@@ -160,16 +165,16 @@ TEST_F(ProxyResolverV8TracingTest, JavascriptError) {
for (size_t list_i = 0; list_i < arraysize(entries_list); list_i++) {
const CapturingNetLog::CapturedEntryList& entries = entries_list[list_i];
EXPECT_EQ(2u, entries.size());
- EXPECT_TRUE(
- LogContainsEvent(entries, 0, NetLog::TYPE_PAC_JAVASCRIPT_ALERT,
- NetLog::PHASE_NONE));
- EXPECT_TRUE(
- LogContainsEvent(entries, 1, NetLog::TYPE_PAC_JAVASCRIPT_ERROR,
- NetLog::PHASE_NONE));
+ EXPECT_TRUE(LogContainsEvent(
+ entries, 0, NetLog::TYPE_PAC_JAVASCRIPT_ALERT, NetLog::PHASE_NONE));
+ EXPECT_TRUE(LogContainsEvent(
+ entries, 1, NetLog::TYPE_PAC_JAVASCRIPT_ERROR, NetLog::PHASE_NONE));
EXPECT_EQ("{\"message\":\"Prepare to DIE!\"}", entries[0].GetParamsJson());
- EXPECT_EQ("{\"line_number\":5,\"message\":\"Uncaught TypeError: Cannot "
- "read property 'split' of null\"}", entries[1].GetParamsJson());
+ EXPECT_EQ(
+ "{\"line_number\":5,\"message\":\"Uncaught TypeError: Cannot "
+ "read property 'split' of null\"}",
+ entries[1].GetParamsJson());
}
}
@@ -185,12 +190,11 @@ TEST_F(ProxyResolverV8TracingTest, TooManyAlerts) {
TestCompletionCallback callback;
ProxyInfo proxy_info;
- int rv = resolver.GetProxyForURL(
- GURL("http://foo/"),
- &proxy_info,
- callback.callback(),
- NULL,
- request_log.bound());
+ int rv = resolver.GetProxyForURL(GURL("http://foo/"),
+ &proxy_info,
+ callback.callback(),
+ NULL,
+ request_log.bound());
EXPECT_EQ(ERR_IO_PENDING, rv);
EXPECT_EQ(OK, callback.WaitForResult());
@@ -215,9 +219,8 @@ TEST_F(ProxyResolverV8TracingTest, TooManyAlerts) {
const CapturingNetLog::CapturedEntryList& entries = entries_list[list_i];
EXPECT_EQ(50u, entries.size());
for (size_t i = 0; i < entries.size(); ++i) {
- ASSERT_TRUE(
- LogContainsEvent(entries, i, NetLog::TYPE_PAC_JAVASCRIPT_ALERT,
- NetLog::PHASE_NONE));
+ ASSERT_TRUE(LogContainsEvent(
+ entries, i, NetLog::TYPE_PAC_JAVASCRIPT_ALERT, NetLog::PHASE_NONE));
}
}
}
@@ -236,12 +239,11 @@ TEST_F(ProxyResolverV8TracingTest, TooManyEmptyAlerts) {
TestCompletionCallback callback;
ProxyInfo proxy_info;
- int rv = resolver.GetProxyForURL(
- GURL("http://foo/"),
- &proxy_info,
- callback.callback(),
- NULL,
- request_log.bound());
+ int rv = resolver.GetProxyForURL(GURL("http://foo/"),
+ &proxy_info,
+ callback.callback(),
+ NULL,
+ request_log.bound());
EXPECT_EQ(ERR_IO_PENDING, rv);
EXPECT_EQ(OK, callback.WaitForResult());
@@ -263,9 +265,8 @@ TEST_F(ProxyResolverV8TracingTest, TooManyEmptyAlerts) {
const CapturingNetLog::CapturedEntryList& entries = entries_list[list_i];
EXPECT_EQ(1000u, entries.size());
for (size_t i = 0; i < entries.size(); ++i) {
- ASSERT_TRUE(
- LogContainsEvent(entries, i, NetLog::TYPE_PAC_JAVASCRIPT_ALERT,
- NetLog::PHASE_NONE));
+ ASSERT_TRUE(LogContainsEvent(
+ entries, i, NetLog::TYPE_PAC_JAVASCRIPT_ALERT, NetLog::PHASE_NONE));
}
}
}
@@ -282,8 +283,8 @@ TEST_F(ProxyResolverV8TracingTest, Dns) {
host_resolver.rules()->AddRuleForAddressFamily(
"host1", ADDRESS_FAMILY_IPV4, "166.155.144.44");
- host_resolver.rules()
- ->AddIPLiteralRule("host1", "::1,192.168.1.1", std::string());
+ host_resolver.rules()->AddIPLiteralRule(
+ "host1", "::1,192.168.1.1", std::string());
host_resolver.rules()->AddSimulatedFailure("host2");
host_resolver.rules()->AddRule("host3", "166.155.144.33");
host_resolver.rules()->AddRule("host5", "166.155.144.55");
@@ -297,12 +298,11 @@ TEST_F(ProxyResolverV8TracingTest, Dns) {
TestCompletionCallback callback;
ProxyInfo proxy_info;
- int rv = resolver.GetProxyForURL(
- GURL("http://foo/"),
- &proxy_info,
- callback.callback(),
- NULL,
- request_log.bound());
+ int rv = resolver.GetProxyForURL(GURL("http://foo/"),
+ &proxy_info,
+ callback.callback(),
+ NULL,
+ request_log.bound());
EXPECT_EQ(ERR_IO_PENDING, rv);
EXPECT_EQ(OK, callback.WaitForResult());
@@ -311,20 +311,20 @@ TEST_F(ProxyResolverV8TracingTest, Dns) {
EXPECT_EQ(7u, host_resolver.num_resolve());
const char* kExpectedResult =
- "122.133.144.155-" // myIpAddress()
- "null-" // dnsResolve('')
- "__1_192.168.1.1-" // dnsResolveEx('host1')
- "null-" // dnsResolve('host2')
- "166.155.144.33-" // dnsResolve('host3')
- "122.133.144.155-" // myIpAddress()
- "166.155.144.33-" // dnsResolve('host3')
- "__1_192.168.1.1-" // dnsResolveEx('host1')
- "122.133.144.155-" // myIpAddress()
- "null-" // dnsResolve('host2')
- "-" // dnsResolveEx('host6')
- "133.122.100.200-" // myIpAddressEx()
- "166.155.144.44" // dnsResolve('host1')
- ":99";
+ "122.133.144.155-" // myIpAddress()
+ "null-" // dnsResolve('')
+ "__1_192.168.1.1-" // dnsResolveEx('host1')
+ "null-" // dnsResolve('host2')
+ "166.155.144.33-" // dnsResolve('host3')
+ "122.133.144.155-" // myIpAddress()
+ "166.155.144.33-" // dnsResolve('host3')
+ "__1_192.168.1.1-" // dnsResolveEx('host1')
+ "122.133.144.155-" // myIpAddress()
+ "null-" // dnsResolve('host2')
+ "-" // dnsResolveEx('host6')
+ "133.122.100.200-" // myIpAddressEx()
+ "166.155.144.44" // dnsResolve('host1')
+ ":99";
EXPECT_EQ(kExpectedResult, proxy_info.proxy_server().ToURI());
@@ -340,9 +340,8 @@ TEST_F(ProxyResolverV8TracingTest, Dns) {
for (size_t list_i = 0; list_i < arraysize(entries_list); list_i++) {
const CapturingNetLog::CapturedEntryList& entries = entries_list[list_i];
EXPECT_EQ(1u, entries.size());
- EXPECT_TRUE(
- LogContainsEvent(entries, 0, NetLog::TYPE_PAC_JAVASCRIPT_ALERT,
- NetLog::PHASE_NONE));
+ EXPECT_TRUE(LogContainsEvent(
+ entries, 0, NetLog::TYPE_PAC_JAVASCRIPT_ALERT, NetLog::PHASE_NONE));
EXPECT_EQ("{\"message\":\"iteration: 7\"}", entries[0].GetParamsJson());
}
}
@@ -366,12 +365,11 @@ TEST_F(ProxyResolverV8TracingTest, DnsChecksCache) {
TestCompletionCallback callback2;
ProxyInfo proxy_info;
- int rv = resolver.GetProxyForURL(
- GURL("http://foopy/req1"),
- &proxy_info,
- callback1.callback(),
- NULL,
- request_log.bound());
+ int rv = resolver.GetProxyForURL(GURL("http://foopy/req1"),
+ &proxy_info,
+ callback1.callback(),
+ NULL,
+ request_log.bound());
EXPECT_EQ(ERR_IO_PENDING, rv);
EXPECT_EQ(OK, callback1.WaitForResult());
@@ -382,12 +380,11 @@ TEST_F(ProxyResolverV8TracingTest, DnsChecksCache) {
// The first request took 2 restarts, hence on g_iteration=3.
EXPECT_EQ("166.155.144.11:3", proxy_info.proxy_server().ToURI());
- rv = resolver.GetProxyForURL(
- GURL("http://foopy/req2"),
- &proxy_info,
- callback2.callback(),
- NULL,
- request_log.bound());
+ rv = resolver.GetProxyForURL(GURL("http://foopy/req2"),
+ &proxy_info,
+ callback2.callback(),
+ NULL,
+ request_log.bound());
EXPECT_EQ(ERR_IO_PENDING, rv);
EXPECT_EQ(OK, callback2.WaitForResult());
@@ -423,9 +420,11 @@ TEST_F(ProxyResolverV8TracingTest, FallBackToSynchronous1) {
TestCompletionCallback callback;
ProxyInfo proxy_info;
- int rv = resolver.GetProxyForURL(
- GURL("http://foo/"), &proxy_info, callback.callback(), NULL,
- request_log.bound());
+ int rv = resolver.GetProxyForURL(GURL("http://foo/"),
+ &proxy_info,
+ callback.callback(),
+ NULL,
+ request_log.bound());
EXPECT_EQ(ERR_IO_PENDING, rv);
EXPECT_EQ(OK, callback.WaitForResult());
@@ -449,9 +448,8 @@ TEST_F(ProxyResolverV8TracingTest, FallBackToSynchronous1) {
for (size_t list_i = 0; list_i < arraysize(entries_list); list_i++) {
const CapturingNetLog::CapturedEntryList& entries = entries_list[list_i];
EXPECT_EQ(1u, entries.size());
- EXPECT_TRUE(
- LogContainsEvent(entries, 0, NetLog::TYPE_PAC_JAVASCRIPT_ALERT,
- NetLog::PHASE_NONE));
+ EXPECT_TRUE(LogContainsEvent(
+ entries, 0, NetLog::TYPE_PAC_JAVASCRIPT_ALERT, NetLog::PHASE_NONE));
EXPECT_EQ("{\"message\":\"iteration: 4\"}", entries[0].GetParamsJson());
}
}
@@ -477,9 +475,11 @@ TEST_F(ProxyResolverV8TracingTest, FallBackToSynchronous2) {
TestCompletionCallback callback;
ProxyInfo proxy_info;
- int rv = resolver.GetProxyForURL(
- GURL("http://foo/"), &proxy_info, callback.callback(), NULL,
- request_log.bound());
+ int rv = resolver.GetProxyForURL(GURL("http://foo/"),
+ &proxy_info,
+ callback.callback(),
+ NULL,
+ request_log.bound());
EXPECT_EQ(ERR_IO_PENDING, rv);
EXPECT_EQ(OK, callback.WaitForResult());
@@ -514,9 +514,11 @@ TEST_F(ProxyResolverV8TracingTest, InfiniteDNSSequence) {
TestCompletionCallback callback;
ProxyInfo proxy_info;
- int rv = resolver.GetProxyForURL(
- GURL("http://foo/"), &proxy_info, callback.callback(), NULL,
- request_log.bound());
+ int rv = resolver.GetProxyForURL(GURL("http://foo/"),
+ &proxy_info,
+ callback.callback(),
+ NULL,
+ request_log.bound());
EXPECT_EQ(ERR_IO_PENDING, rv);
EXPECT_EQ(OK, callback.WaitForResult());
@@ -528,7 +530,8 @@ TEST_F(ProxyResolverV8TracingTest, InfiniteDNSSequence) {
"166.155.144.11-166.155.144.11-166.155.144.11-166.155.144.11-"
"166.155.144.11-166.155.144.11-166.155.144.11-166.155.144.11-"
"166.155.144.11-166.155.144.11-166.155.144.11-166.155.144.11-"
- "null:21", proxy_info.proxy_server().ToURI());
+ "null:21",
+ proxy_info.proxy_server().ToURI());
// No errors.
EXPECT_EQ("", error_observer->GetOutput());
@@ -557,9 +560,11 @@ TEST_F(ProxyResolverV8TracingTest, InfiniteDNSSequence2) {
TestCompletionCallback callback;
ProxyInfo proxy_info;
- int rv = resolver.GetProxyForURL(
- GURL("http://foo/"), &proxy_info, callback.callback(), NULL,
- request_log.bound());
+ int rv = resolver.GetProxyForURL(GURL("http://foo/"),
+ &proxy_info,
+ callback.callback(),
+ NULL,
+ request_log.bound());
EXPECT_EQ(ERR_IO_PENDING, rv);
EXPECT_EQ(OK, callback.WaitForResult());
@@ -600,9 +605,11 @@ void DnsDuringInitHelper(bool synchronous_host_resolver) {
TestCompletionCallback callback;
ProxyInfo proxy_info;
- int rv = resolver.GetProxyForURL(
- GURL("http://foo/"), &proxy_info, callback.callback(), NULL,
- request_log.bound());
+ int rv = resolver.GetProxyForURL(GURL("http://foo/"),
+ &proxy_info,
+ callback.callback(),
+ NULL,
+ request_log.bound());
EXPECT_EQ(ERR_IO_PENDING, rv);
EXPECT_EQ(OK, callback.WaitForResult());
@@ -619,12 +626,10 @@ void DnsDuringInitHelper(bool synchronous_host_resolver) {
log.GetEntries(&entries);
ASSERT_EQ(2u, entries.size());
- EXPECT_TRUE(
- LogContainsEvent(entries, 0, NetLog::TYPE_PAC_JAVASCRIPT_ALERT,
- NetLog::PHASE_NONE));
- EXPECT_TRUE(
- LogContainsEvent(entries, 1, NetLog::TYPE_PAC_JAVASCRIPT_ALERT,
- NetLog::PHASE_NONE));
+ EXPECT_TRUE(LogContainsEvent(
+ entries, 0, NetLog::TYPE_PAC_JAVASCRIPT_ALERT, NetLog::PHASE_NONE));
+ EXPECT_TRUE(LogContainsEvent(
+ entries, 1, NetLog::TYPE_PAC_JAVASCRIPT_ALERT, NetLog::PHASE_NONE));
EXPECT_EQ("{\"message\":\"Watsup\"}", entries[0].GetParamsJson());
EXPECT_EQ("{\"message\":\"Watsup2\"}", entries[1].GetParamsJson());
@@ -661,9 +666,11 @@ TEST_F(ProxyResolverV8TracingTest, CancelAll) {
ProxyResolver::RequestHandle request[kNumRequests];
for (size_t i = 0; i < kNumRequests; ++i) {
- int rv = resolver.GetProxyForURL(
- GURL("http://foo/"), &proxy_info[i],
- base::Bind(&CrashCallback), &request[i], BoundNetLog());
+ int rv = resolver.GetProxyForURL(GURL("http://foo/"),
+ &proxy_info[i],
+ base::Bind(&CrashCallback),
+ &request[i],
+ BoundNetLog());
EXPECT_EQ(ERR_IO_PENDING, rv);
}
@@ -690,14 +697,18 @@ TEST_F(ProxyResolverV8TracingTest, CancelSome) {
ProxyResolver::RequestHandle request2;
TestCompletionCallback callback;
- int rv = resolver.GetProxyForURL(
- GURL("http://foo/"), &proxy_info1,
- base::Bind(&CrashCallback), &request1, BoundNetLog());
+ int rv = resolver.GetProxyForURL(GURL("http://foo/"),
+ &proxy_info1,
+ base::Bind(&CrashCallback),
+ &request1,
+ BoundNetLog());
EXPECT_EQ(ERR_IO_PENDING, rv);
- rv = resolver.GetProxyForURL(
- GURL("http://foo/"), &proxy_info2,
- callback.callback(), &request2, BoundNetLog());
+ rv = resolver.GetProxyForURL(GURL("http://foo/"),
+ &proxy_info2,
+ callback.callback(),
+ &request2,
+ BoundNetLog());
EXPECT_EQ(ERR_IO_PENDING, rv);
resolver.CancelRequest(request1);
@@ -724,14 +735,18 @@ TEST_F(ProxyResolverV8TracingTest, CancelWhilePendingCompletionTask) {
ProxyResolver::RequestHandle request3;
TestCompletionCallback callback;
- int rv = resolver.GetProxyForURL(
- GURL("http://foo/"), &proxy_info1,
- base::Bind(&CrashCallback), &request1, BoundNetLog());
+ int rv = resolver.GetProxyForURL(GURL("http://foo/"),
+ &proxy_info1,
+ base::Bind(&CrashCallback),
+ &request1,
+ BoundNetLog());
EXPECT_EQ(ERR_IO_PENDING, rv);
- rv = resolver.GetProxyForURL(
- GURL("http://throw-an-error/"), &proxy_info2,
- callback.callback(), &request2, BoundNetLog());
+ rv = resolver.GetProxyForURL(GURL("http://throw-an-error/"),
+ &proxy_info2,
+ callback.callback(),
+ &request2,
+ BoundNetLog());
EXPECT_EQ(ERR_IO_PENDING, rv);
// Wait until the first request has finished running on the worker thread.
@@ -745,15 +760,16 @@ TEST_F(ProxyResolverV8TracingTest, CancelWhilePendingCompletionTask) {
EXPECT_EQ(ERR_PAC_SCRIPT_FAILED, callback.WaitForResult());
// Start another request, to make sure it is able to complete.
- rv = resolver.GetProxyForURL(
- GURL("http://i-have-no-idea-what-im-doing/"), &proxy_info3,
- callback.callback(), &request3, BoundNetLog());
+ rv = resolver.GetProxyForURL(GURL("http://i-have-no-idea-what-im-doing/"),
+ &proxy_info3,
+ callback.callback(),
+ &request3,
+ BoundNetLog());
EXPECT_EQ(ERR_IO_PENDING, rv);
EXPECT_EQ(OK, callback.WaitForResult());
- EXPECT_EQ("i-approve-this-message:42",
- proxy_info3.proxy_server().ToURI());
+ EXPECT_EQ("i-approve-this-message:42", proxy_info3.proxy_server().ToURI());
}
// This implementation of HostResolver allows blocking until a resolve request
@@ -801,9 +817,7 @@ class BlockableHostResolver : public HostResolver {
num_cancelled_requests_++;
}
- void SetAction(const base::Callback<void(void)>& action) {
- action_ = action;
- }
+ void SetAction(const base::Callback<void(void)>& action) { action_ = action; }
// Waits until Resolve() has been called.
void WaitUntilRequestIsReceived() {
@@ -813,9 +827,7 @@ class BlockableHostResolver : public HostResolver {
waiting_for_resolve_ = false;
}
- int num_cancelled_requests() const {
- return num_cancelled_requests_;
- }
+ int num_cancelled_requests() const { return num_cancelled_requests_; }
private:
int num_cancelled_requests_;
@@ -837,17 +849,21 @@ TEST_F(ProxyResolverV8TracingTest, CancelWhileOutstandingNonBlockingDns) {
ProxyResolver::RequestHandle request1;
ProxyResolver::RequestHandle request2;
- int rv = resolver.GetProxyForURL(
- GURL("http://foo/req1"), &proxy_info1,
- base::Bind(&CrashCallback), &request1, BoundNetLog());
+ int rv = resolver.GetProxyForURL(GURL("http://foo/req1"),
+ &proxy_info1,
+ base::Bind(&CrashCallback),
+ &request1,
+ BoundNetLog());
EXPECT_EQ(ERR_IO_PENDING, rv);
host_resolver.WaitUntilRequestIsReceived();
- rv = resolver.GetProxyForURL(
- GURL("http://foo/req2"), &proxy_info2,
- base::Bind(&CrashCallback), &request2, BoundNetLog());
+ rv = resolver.GetProxyForURL(GURL("http://foo/req2"),
+ &proxy_info2,
+ base::Bind(&CrashCallback),
+ &request2,
+ BoundNetLog());
EXPECT_EQ(ERR_IO_PENDING, rv);
@@ -886,9 +902,11 @@ TEST_F(ProxyResolverV8TracingTest, CancelWhileBlockedInNonBlockingDns) {
ProxyInfo proxy_info;
ProxyResolver::RequestHandle request;
- int rv = resolver.GetProxyForURL(
- GURL("http://foo/"), &proxy_info,
- base::Bind(&CrashCallback), &request, BoundNetLog());
+ int rv = resolver.GetProxyForURL(GURL("http://foo/"),
+ &proxy_info,
+ base::Bind(&CrashCallback),
+ &request,
+ BoundNetLog());
EXPECT_EQ(ERR_IO_PENDING, rv);
@@ -915,9 +933,11 @@ TEST_F(ProxyResolverV8TracingTest, CancelWhileBlockedInNonBlockingDns2) {
ProxyInfo proxy_info;
ProxyResolver::RequestHandle request;
- int rv = resolver.GetProxyForURL(
- GURL("http://foo/"), &proxy_info,
- base::Bind(&CrashCallback), &request, BoundNetLog());
+ int rv = resolver.GetProxyForURL(GURL("http://foo/"),
+ &proxy_info,
+ base::Bind(&CrashCallback),
+ &request,
+ BoundNetLog());
EXPECT_EQ(ERR_IO_PENDING, rv);
@@ -936,9 +956,8 @@ TEST_F(ProxyResolverV8TracingTest, CancelSetPacWhileOutstandingBlockingDns) {
ProxyResolverV8Tracing resolver(&host_resolver, error_observer, NULL);
- int rv =
- resolver.SetPacScript(LoadScriptData("dns_during_init.js"),
- base::Bind(&CrashCallback));
+ int rv = resolver.SetPacScript(LoadScriptData("dns_during_init.js"),
+ base::Bind(&CrashCallback));
EXPECT_EQ(ERR_IO_PENDING, rv);
host_resolver.WaitUntilRequestIsReceived();
@@ -964,12 +983,11 @@ TEST_F(ProxyResolverV8TracingTest, Terminate) {
TestCompletionCallback callback;
ProxyInfo proxy_info;
- int rv = resolver.GetProxyForURL(
- GURL("http://foopy/req1"),
- &proxy_info,
- callback.callback(),
- NULL,
- request_log.bound());
+ int rv = resolver.GetProxyForURL(GURL("http://foopy/req1"),
+ &proxy_info,
+ callback.callback(),
+ NULL,
+ request_log.bound());
EXPECT_EQ(ERR_IO_PENDING, rv);
EXPECT_EQ(OK, callback.WaitForResult());
@@ -997,8 +1015,8 @@ TEST_F(ProxyResolverV8TracingTest, MultipleResolvers) {
MockHostResolver host_resolver0;
host_resolver0.rules()->AddRuleForAddressFamily(
"host1", ADDRESS_FAMILY_IPV4, "166.155.144.44");
- host_resolver0.rules()
- ->AddIPLiteralRule("host1", "::1,192.168.1.1", std::string());
+ host_resolver0.rules()->AddIPLiteralRule(
+ "host1", "::1,192.168.1.1", std::string());
host_resolver0.rules()->AddSimulatedFailure("host2");
host_resolver0.rules()->AddRule("host3", "166.155.144.33");
host_resolver0.rules()->AddRule("host5", "166.155.144.55");
@@ -1038,7 +1056,7 @@ TEST_F(ProxyResolverV8TracingTest, MultipleResolvers) {
// ------------------------
ProxyResolverV8Tracing* resolver[] = {
- &resolver0, &resolver1, &resolver2, &resolver3,
+ &resolver0, &resolver1, &resolver2, &resolver3,
};
const size_t kNumResolvers = arraysize(resolver);
@@ -1049,9 +1067,11 @@ TEST_F(ProxyResolverV8TracingTest, MultipleResolvers) {
for (size_t i = 0; i < kNumResults; ++i) {
size_t resolver_i = i % kNumResolvers;
- int rv = resolver[resolver_i]->GetProxyForURL(
- GURL("http://foo/"), &proxy_info[i], callback[i].callback(), NULL,
- BoundNetLog());
+ int rv = resolver[resolver_i]->GetProxyForURL(GURL("http://foo/"),
+ &proxy_info[i],
+ callback[i].callback(),
+ NULL,
+ BoundNetLog());
EXPECT_EQ(ERR_IO_PENDING, rv);
}
@@ -1060,20 +1080,20 @@ TEST_F(ProxyResolverV8TracingTest, MultipleResolvers) {
// ------------------------
const char* kExpectedForDnsJs =
- "122.133.144.155-" // myIpAddress()
- "null-" // dnsResolve('')
- "__1_192.168.1.1-" // dnsResolveEx('host1')
- "null-" // dnsResolve('host2')
- "166.155.144.33-" // dnsResolve('host3')
- "122.133.144.155-" // myIpAddress()
- "166.155.144.33-" // dnsResolve('host3')
- "__1_192.168.1.1-" // dnsResolveEx('host1')
- "122.133.144.155-" // myIpAddress()
- "null-" // dnsResolve('host2')
- "-" // dnsResolveEx('host6')
- "133.122.100.200-" // myIpAddressEx()
- "166.155.144.44" // dnsResolve('host1')
- ":99";
+ "122.133.144.155-" // myIpAddress()
+ "null-" // dnsResolve('')
+ "__1_192.168.1.1-" // dnsResolveEx('host1')
+ "null-" // dnsResolve('host2')
+ "166.155.144.33-" // dnsResolve('host3')
+ "122.133.144.155-" // myIpAddress()
+ "166.155.144.33-" // dnsResolve('host3')
+ "__1_192.168.1.1-" // dnsResolveEx('host1')
+ "122.133.144.155-" // myIpAddress()
+ "null-" // dnsResolve('host2')
+ "-" // dnsResolveEx('host6')
+ "133.122.100.200-" // myIpAddressEx()
+ "166.155.144.44" // dnsResolve('host1')
+ ":99";
for (size_t i = 0; i < kNumResults; ++i) {
size_t resolver_i = i % kNumResolvers;

Powered by Google App Engine
This is Rietveld 408576698