diff options
Diffstat (limited to 'net/proxy/proxy_resolver_v8_unittest.cc')
-rw-r--r-- | net/proxy/proxy_resolver_v8_unittest.cc | 96 |
1 files changed, 48 insertions, 48 deletions
diff --git a/net/proxy/proxy_resolver_v8_unittest.cc b/net/proxy/proxy_resolver_v8_unittest.cc index aa97004..9782bb1 100644 --- a/net/proxy/proxy_resolver_v8_unittest.cc +++ b/net/proxy/proxy_resolver_v8_unittest.cc @@ -115,7 +115,7 @@ class ProxyResolverV8WithMockBindings : public ProxyResolverV8 { // Load the PAC script into the ProxyResolver. return SetPacScript(ProxyResolverScriptData::FromUTF8(file_contents), - NULL); + CompletionCallback()); } }; @@ -131,8 +131,8 @@ TEST(ProxyResolverV8Test, Direct) { ProxyInfo proxy_info; CapturingBoundNetLog log(CapturingNetLog::kUnbounded); - result = resolver.GetProxyForURL(kQueryUrl, &proxy_info, NULL, NULL, - log.bound()); + result = resolver.GetProxyForURL( + kQueryUrl, &proxy_info, CompletionCallback(), NULL, log.bound()); EXPECT_EQ(OK, result); EXPECT_TRUE(proxy_info.is_direct()); @@ -152,8 +152,8 @@ TEST(ProxyResolverV8Test, ReturnEmptyString) { EXPECT_EQ(OK, result); ProxyInfo proxy_info; - result = resolver.GetProxyForURL(kQueryUrl, &proxy_info, NULL, NULL, - BoundNetLog()); + result = resolver.GetProxyForURL( + kQueryUrl, &proxy_info, CompletionCallback(), NULL, BoundNetLog()); EXPECT_EQ(OK, result); EXPECT_TRUE(proxy_info.is_direct()); @@ -172,17 +172,17 @@ TEST(ProxyResolverV8Test, Basic) { // the correct arguments are being passed to FindProxyForURL(). { ProxyInfo proxy_info; - result = resolver.GetProxyForURL(GURL("http://query.com/path"), - &proxy_info, NULL, NULL, BoundNetLog()); + result = resolver.GetProxyForURL(GURL("http://query.com/path"), &proxy_info, + CompletionCallback(), NULL, BoundNetLog()); EXPECT_EQ(OK, result); EXPECT_EQ("http.query.com.path.query.com:80", proxy_info.proxy_server().ToURI()); } { ProxyInfo proxy_info; - int result = resolver.GetProxyForURL(GURL("ftp://query.com:90/path"), - &proxy_info, NULL, NULL, - BoundNetLog()); + int result = resolver.GetProxyForURL( + GURL("ftp://query.com:90/path"), &proxy_info, CompletionCallback(), + NULL, BoundNetLog()); EXPECT_EQ(OK, result); // Note that FindProxyForURL(url, host) does not expect |host| to contain // the port number. @@ -220,8 +220,8 @@ TEST(ProxyResolverV8Test, BadReturnType) { EXPECT_EQ(OK, result); ProxyInfo proxy_info; - result = resolver.GetProxyForURL(kQueryUrl, &proxy_info, NULL, NULL, - BoundNetLog()); + result = resolver.GetProxyForURL( + kQueryUrl, &proxy_info, CompletionCallback(), NULL, BoundNetLog()); EXPECT_EQ(ERR_PAC_SCRIPT_FAILED, result); @@ -241,8 +241,8 @@ TEST(ProxyResolverV8Test, NoEntryPoint) { EXPECT_EQ(ERR_PAC_SCRIPT_FAILED, result); ProxyInfo proxy_info; - result = resolver.GetProxyForURL(kQueryUrl, &proxy_info, NULL, NULL, - BoundNetLog()); + result = resolver.GetProxyForURL( + kQueryUrl, &proxy_info, CompletionCallback(), NULL, BoundNetLog()); EXPECT_EQ(ERR_FAILED, result); } @@ -254,8 +254,8 @@ TEST(ProxyResolverV8Test, ParseError) { EXPECT_EQ(ERR_PAC_SCRIPT_FAILED, result); ProxyInfo proxy_info; - result = resolver.GetProxyForURL(kQueryUrl, &proxy_info, NULL, NULL, - BoundNetLog()); + result = resolver.GetProxyForURL( + kQueryUrl, &proxy_info, CompletionCallback(), NULL, BoundNetLog()); EXPECT_EQ(ERR_FAILED, result); @@ -278,8 +278,8 @@ TEST(ProxyResolverV8Test, SideEffects) { // The PAC script increments a counter each time we invoke it. for (int i = 0; i < 3; ++i) { ProxyInfo proxy_info; - result = resolver.GetProxyForURL(kQueryUrl, &proxy_info, NULL, NULL, - BoundNetLog()); + result = resolver.GetProxyForURL( + kQueryUrl, &proxy_info, CompletionCallback(), NULL, BoundNetLog()); EXPECT_EQ(OK, result); EXPECT_EQ(base::StringPrintf("sideffect_%d:80", i), proxy_info.proxy_server().ToURI()); @@ -292,8 +292,8 @@ TEST(ProxyResolverV8Test, SideEffects) { for (int i = 0; i < 3; ++i) { ProxyInfo proxy_info; - result = resolver.GetProxyForURL(kQueryUrl, &proxy_info, NULL, NULL, - BoundNetLog()); + result = resolver.GetProxyForURL( + kQueryUrl, &proxy_info, CompletionCallback(), NULL, BoundNetLog()); EXPECT_EQ(OK, result); EXPECT_EQ(base::StringPrintf("sideffect_%d:80", i), proxy_info.proxy_server().ToURI()); @@ -307,8 +307,8 @@ TEST(ProxyResolverV8Test, UnhandledException) { EXPECT_EQ(OK, result); ProxyInfo proxy_info; - result = resolver.GetProxyForURL(kQueryUrl, &proxy_info, NULL, NULL, - BoundNetLog()); + result = resolver.GetProxyForURL( + kQueryUrl, &proxy_info, CompletionCallback(), NULL, BoundNetLog()); EXPECT_EQ(ERR_PAC_SCRIPT_FAILED, result); @@ -326,23 +326,23 @@ TEST(ProxyResolverV8Test, ReturnUnicode) { EXPECT_EQ(OK, result); ProxyInfo proxy_info; - result = resolver.GetProxyForURL(kQueryUrl, &proxy_info, NULL, NULL, - BoundNetLog()); + result = resolver.GetProxyForURL( + kQueryUrl, &proxy_info, CompletionCallback(), NULL, BoundNetLog()); // The result from this resolve was unparseable, because it // wasn't ASCII. EXPECT_EQ(ERR_PAC_SCRIPT_FAILED, result); } -// Test the PAC library functions that we expose in the JS environmnet. +// Test the PAC library functions that we expose in the JS environment. TEST(ProxyResolverV8Test, JavascriptLibrary) { ProxyResolverV8WithMockBindings resolver; int result = resolver.SetPacScriptFromDisk("pac_library_unittest.js"); EXPECT_EQ(OK, result); ProxyInfo proxy_info; - result = resolver.GetProxyForURL(kQueryUrl, &proxy_info, NULL, NULL, - BoundNetLog()); + result = resolver.GetProxyForURL( + kQueryUrl, &proxy_info, CompletionCallback(), NULL, BoundNetLog()); // If the javascript side of this unit-test fails, it will throw a javascript // exception. Otherwise it will return "PROXY success:80". @@ -360,8 +360,8 @@ TEST(ProxyResolverV8Test, NoSetPacScript) { ProxyInfo proxy_info; // Resolve should fail, as we are not yet initialized with a script. - int result = resolver.GetProxyForURL(kQueryUrl, &proxy_info, NULL, NULL, - BoundNetLog()); + int result = resolver.GetProxyForURL( + kQueryUrl, &proxy_info, CompletionCallback(), NULL, BoundNetLog()); EXPECT_EQ(ERR_FAILED, result); // Initialize it. @@ -369,24 +369,24 @@ TEST(ProxyResolverV8Test, NoSetPacScript) { EXPECT_EQ(OK, result); // Resolve should now succeed. - result = resolver.GetProxyForURL(kQueryUrl, &proxy_info, NULL, NULL, - BoundNetLog()); + result = resolver.GetProxyForURL( + kQueryUrl, &proxy_info, CompletionCallback(), NULL, BoundNetLog()); EXPECT_EQ(OK, result); // Clear it, by initializing with an empty string. resolver.SetPacScript( - ProxyResolverScriptData::FromUTF16(string16()), NULL); + ProxyResolverScriptData::FromUTF16(string16()), CompletionCallback()); // Resolve should fail again now. - result = resolver.GetProxyForURL(kQueryUrl, &proxy_info, NULL, NULL, - BoundNetLog()); + result = resolver.GetProxyForURL( + kQueryUrl, &proxy_info, CompletionCallback(), NULL, BoundNetLog()); EXPECT_EQ(ERR_FAILED, result); // Load a good script once more. result = resolver.SetPacScriptFromDisk("direct.js"); EXPECT_EQ(OK, result); - result = resolver.GetProxyForURL(kQueryUrl, &proxy_info, NULL, NULL, - BoundNetLog()); + result = resolver.GetProxyForURL( + kQueryUrl, &proxy_info, CompletionCallback(), NULL, BoundNetLog()); EXPECT_EQ(OK, result); EXPECT_EQ(0U, resolver.mock_js_bindings()->alerts.size()); @@ -402,8 +402,8 @@ TEST(ProxyResolverV8Test, V8Bindings) { EXPECT_EQ(OK, result); ProxyInfo proxy_info; - result = resolver.GetProxyForURL(kQueryUrl, &proxy_info, NULL, NULL, - BoundNetLog()); + result = resolver.GetProxyForURL( + kQueryUrl, &proxy_info, CompletionCallback(), NULL, BoundNetLog()); EXPECT_EQ(OK, result); EXPECT_TRUE(proxy_info.is_direct()); @@ -450,8 +450,8 @@ TEST(ProxyResolverV8Test, BindingCalledDuringInitialization) { EXPECT_EQ(1, bindings->my_ip_address_count); ProxyInfo proxy_info; - result = resolver.GetProxyForURL(kQueryUrl, &proxy_info, NULL, NULL, - BoundNetLog()); + result = resolver.GetProxyForURL( + kQueryUrl, &proxy_info, CompletionCallback(), NULL, BoundNetLog()); EXPECT_EQ(OK, result); EXPECT_FALSE(proxy_info.is_direct()); @@ -476,8 +476,8 @@ TEST(ProxyResolverV8Test, EndsWithCommentNoNewline) { ProxyInfo proxy_info; CapturingBoundNetLog log(CapturingNetLog::kUnbounded); - result = resolver.GetProxyForURL(kQueryUrl, &proxy_info, NULL, NULL, - log.bound()); + result = resolver.GetProxyForURL( + kQueryUrl, &proxy_info, CompletionCallback(), NULL, log.bound()); EXPECT_EQ(OK, result); EXPECT_FALSE(proxy_info.is_direct()); @@ -496,8 +496,8 @@ TEST(ProxyResolverV8Test, EndsWithStatementNoNewline) { ProxyInfo proxy_info; CapturingBoundNetLog log(CapturingNetLog::kUnbounded); - result = resolver.GetProxyForURL(kQueryUrl, &proxy_info, NULL, NULL, - log.bound()); + result = resolver.GetProxyForURL( + kQueryUrl, &proxy_info, CompletionCallback(), NULL, log.bound()); EXPECT_EQ(OK, result); EXPECT_FALSE(proxy_info.is_direct()); @@ -514,8 +514,8 @@ TEST(ProxyResolverV8Test, DNSResolutionFailure) { EXPECT_EQ(OK, result); ProxyInfo proxy_info; - result = resolver.GetProxyForURL(kQueryUrl, &proxy_info, NULL, NULL, - BoundNetLog()); + result = resolver.GetProxyForURL( + kQueryUrl, &proxy_info, CompletionCallback(), NULL, BoundNetLog()); EXPECT_EQ(OK, result); EXPECT_FALSE(proxy_info.is_direct()); @@ -529,8 +529,8 @@ TEST(ProxyResolverV8Test, DNSResolutionOfInternationDomainName) { // Execute FindProxyForURL(). ProxyInfo proxy_info; - result = resolver.GetProxyForURL(kQueryUrl, &proxy_info, NULL, NULL, - BoundNetLog()); + result = resolver.GetProxyForURL( + kQueryUrl, &proxy_info, CompletionCallback(), NULL, BoundNetLog()); EXPECT_EQ(OK, result); EXPECT_TRUE(proxy_info.is_direct()); |