| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/file_util.h" | 5 #include "base/file_util.h" |
| 6 #include "base/path_service.h" | 6 #include "base/path_service.h" |
| 7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
| 8 #include "base/stringprintf.h" | 8 #include "base/stringprintf.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "googleurl/src/gurl.h" | 10 #include "googleurl/src/gurl.h" |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 CapturingBoundNetLog log(CapturingNetLog::kUnbounded); | 131 CapturingBoundNetLog log(CapturingNetLog::kUnbounded); |
| 132 result = resolver.GetProxyForURL(kQueryUrl, &proxy_info, NULL, NULL, | 132 result = resolver.GetProxyForURL(kQueryUrl, &proxy_info, NULL, NULL, |
| 133 log.bound()); | 133 log.bound()); |
| 134 | 134 |
| 135 EXPECT_EQ(OK, result); | 135 EXPECT_EQ(OK, result); |
| 136 EXPECT_TRUE(proxy_info.is_direct()); | 136 EXPECT_TRUE(proxy_info.is_direct()); |
| 137 | 137 |
| 138 EXPECT_EQ(0U, resolver.mock_js_bindings()->alerts.size()); | 138 EXPECT_EQ(0U, resolver.mock_js_bindings()->alerts.size()); |
| 139 EXPECT_EQ(0U, resolver.mock_js_bindings()->errors.size()); | 139 EXPECT_EQ(0U, resolver.mock_js_bindings()->errors.size()); |
| 140 | 140 |
| 141 net::CapturingNetLog::EntryList entries; |
| 142 log.GetEntries(&entries); |
| 141 // No bindings were called, so no log entries. | 143 // No bindings were called, so no log entries. |
| 142 EXPECT_EQ(0u, log.entries().size()); | 144 EXPECT_EQ(0u, entries.size()); |
| 143 } | 145 } |
| 144 | 146 |
| 145 TEST(ProxyResolverV8Test, ReturnEmptyString) { | 147 TEST(ProxyResolverV8Test, ReturnEmptyString) { |
| 146 ProxyResolverV8WithMockBindings resolver; | 148 ProxyResolverV8WithMockBindings resolver; |
| 147 int result = resolver.SetPacScriptFromDisk("return_empty_string.js"); | 149 int result = resolver.SetPacScriptFromDisk("return_empty_string.js"); |
| 148 EXPECT_EQ(OK, result); | 150 EXPECT_EQ(OK, result); |
| 149 | 151 |
| 150 ProxyInfo proxy_info; | 152 ProxyInfo proxy_info; |
| 151 result = resolver.GetProxyForURL(kQueryUrl, &proxy_info, NULL, NULL, | 153 result = resolver.GetProxyForURL(kQueryUrl, &proxy_info, NULL, NULL, |
| 152 BoundNetLog()); | 154 BoundNetLog()); |
| (...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 537 | 539 |
| 538 ASSERT_EQ(1u, bindings->dns_resolves.size()); | 540 ASSERT_EQ(1u, bindings->dns_resolves.size()); |
| 539 EXPECT_EQ("xn--bcher-kva.ch", bindings->dns_resolves[0]); | 541 EXPECT_EQ("xn--bcher-kva.ch", bindings->dns_resolves[0]); |
| 540 | 542 |
| 541 ASSERT_EQ(1u, bindings->dns_resolves_ex.size()); | 543 ASSERT_EQ(1u, bindings->dns_resolves_ex.size()); |
| 542 EXPECT_EQ("xn--bcher-kva.ch", bindings->dns_resolves_ex[0]); | 544 EXPECT_EQ("xn--bcher-kva.ch", bindings->dns_resolves_ex[0]); |
| 543 } | 545 } |
| 544 | 546 |
| 545 } // namespace | 547 } // namespace |
| 546 } // namespace net | 548 } // namespace net |
| OLD | NEW |