| Index: net/proxy/proxy_resolver_v8_unittest.cc
|
| diff --git a/net/proxy/proxy_resolver_v8_unittest.cc b/net/proxy/proxy_resolver_v8_unittest.cc
|
| index 8540eab120c03c4e5a821dafaf5e49f9ed52348a..e9efa3c222305ce2ff006d3562787b0bf08b3e72 100644
|
| --- a/net/proxy/proxy_resolver_v8_unittest.cc
|
| +++ b/net/proxy/proxy_resolver_v8_unittest.cc
|
| @@ -23,8 +23,10 @@ namespace {
|
| // list, for later verification.
|
| class MockJSBindings : public ProxyResolverV8::JSBindings {
|
| public:
|
| - MockJSBindings() : my_ip_address_count(0), my_ip_address_ex_count(0),
|
| - should_terminate(false) {}
|
| + MockJSBindings()
|
| + : my_ip_address_count(0),
|
| + my_ip_address_ex_count(0),
|
| + should_terminate(false) {}
|
|
|
| virtual void Alert(const base::string16& message) OVERRIDE {
|
| VLOG(1) << "PAC-alert: " << message; // Helpful when debugging.
|
| @@ -98,16 +100,11 @@ class MockJSBindings : public ProxyResolverV8::JSBindings {
|
| // disk.
|
| class ProxyResolverV8WithMockBindings : public ProxyResolverV8 {
|
| public:
|
| - ProxyResolverV8WithMockBindings() {
|
| - set_js_bindings(&mock_js_bindings_);
|
| - }
|
| + ProxyResolverV8WithMockBindings() { set_js_bindings(&mock_js_bindings_); }
|
|
|
| - virtual ~ProxyResolverV8WithMockBindings() {
|
| - }
|
| + virtual ~ProxyResolverV8WithMockBindings() {}
|
|
|
| - MockJSBindings* mock_js_bindings() {
|
| - return &mock_js_bindings_;
|
| - }
|
| + MockJSBindings* mock_js_bindings() { return &mock_js_bindings_; }
|
|
|
| // Initialize with the PAC script data at |filename|.
|
| int SetPacScriptFromDisk(const char* filename) {
|
| @@ -189,17 +186,22 @@ TEST(ProxyResolverV8Test, Basic) {
|
| // the correct arguments are being passed to FindProxyForURL().
|
| {
|
| ProxyInfo proxy_info;
|
| - result = resolver.GetProxyForURL(GURL("http://query.com/path"), &proxy_info,
|
| - CompletionCallback(), 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, CompletionCallback(),
|
| - 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.
|
| @@ -216,13 +218,10 @@ TEST(ProxyResolverV8Test, BadReturnType) {
|
| // types for FindProxyForURL(). They should all fail with
|
| // ERR_PAC_SCRIPT_FAILED.
|
| static const char* const filenames[] = {
|
| - "return_undefined.js",
|
| - "return_integer.js",
|
| - "return_function.js",
|
| + "return_undefined.js", "return_integer.js", "return_function.js",
|
| "return_object.js",
|
| // TODO(eroman): Should 'null' be considered equivalent to "DIRECT" ?
|
| - "return_null.js"
|
| - };
|
| + "return_null.js"};
|
|
|
| for (size_t i = 0; i < arraysize(filenames); ++i) {
|
| ProxyResolverV8WithMockBindings resolver;
|
| @@ -384,9 +383,8 @@ TEST(ProxyResolverV8Test, NoSetPacScript) {
|
| EXPECT_EQ(OK, result);
|
|
|
| // Clear it, by initializing with an empty string.
|
| - resolver.SetPacScript(
|
| - ProxyResolverScriptData::FromUTF16(base::string16()),
|
| - CompletionCallback());
|
| + resolver.SetPacScript(ProxyResolverScriptData::FromUTF16(base::string16()),
|
| + CompletionCallback());
|
|
|
| // Resolve should fail again now.
|
| result = resolver.GetProxyForURL(
|
| @@ -500,8 +498,8 @@ TEST(ProxyResolverV8Test, EndsWithCommentNoNewline) {
|
| // http://crbug.com/22864
|
| TEST(ProxyResolverV8Test, EndsWithStatementNoNewline) {
|
| ProxyResolverV8WithMockBindings resolver;
|
| - int result = resolver.SetPacScriptFromDisk(
|
| - "ends_with_statement_no_semicolon.js");
|
| + int result =
|
| + resolver.SetPacScriptFromDisk("ends_with_statement_no_semicolon.js");
|
| EXPECT_EQ(OK, result);
|
|
|
| ProxyInfo proxy_info;
|
| @@ -565,9 +563,11 @@ TEST(ProxyResolverV8Test, IPv6HostnamesNotBracketed) {
|
| EXPECT_EQ(OK, result);
|
|
|
| ProxyInfo proxy_info;
|
| - result = resolver.GetProxyForURL(
|
| - GURL("http://[abcd::efff]:99/watsupdawg"), &proxy_info,
|
| - CompletionCallback(), NULL, BoundNetLog());
|
| + result = resolver.GetProxyForURL(GURL("http://[abcd::efff]:99/watsupdawg"),
|
| + &proxy_info,
|
| + CompletionCallback(),
|
| + NULL,
|
| + BoundNetLog());
|
|
|
| EXPECT_EQ(OK, result);
|
| EXPECT_TRUE(proxy_info.is_direct());
|
| @@ -594,9 +594,11 @@ TEST(ProxyResolverV8Test, Terminate) {
|
| bindings->should_terminate = true;
|
|
|
| ProxyInfo proxy_info;
|
| - result = resolver.GetProxyForURL(
|
| - GURL("http://hang/"), &proxy_info,
|
| - CompletionCallback(), NULL, BoundNetLog());
|
| + result = resolver.GetProxyForURL(GURL("http://hang/"),
|
| + &proxy_info,
|
| + CompletionCallback(),
|
| + NULL,
|
| + BoundNetLog());
|
|
|
| // The script execution was terminated.
|
| EXPECT_EQ(ERR_PAC_SCRIPT_FAILED, result);
|
| @@ -614,9 +616,11 @@ TEST(ProxyResolverV8Test, Terminate) {
|
|
|
| // Try running the script again, this time with a different input which won't
|
| // cause a termination+hang.
|
| - result = resolver.GetProxyForURL(
|
| - GURL("http://kittens/"), &proxy_info,
|
| - CompletionCallback(), NULL, BoundNetLog());
|
| + result = resolver.GetProxyForURL(GURL("http://kittens/"),
|
| + &proxy_info,
|
| + CompletionCallback(),
|
| + NULL,
|
| + BoundNetLog());
|
|
|
| EXPECT_EQ(OK, result);
|
| EXPECT_EQ(0u, bindings->errors.size());
|
|
|