| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/string_util.h" | 6 #include "base/string_util.h" |
| 7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
| 8 #include "googleurl/src/gurl.h" | 8 #include "googleurl/src/gurl.h" |
| 9 #include "net/base/load_log_unittest.h" | 9 #include "net/base/load_log_unittest.h" |
| 10 #include "net/base/net_errors.h" | 10 #include "net/base/net_errors.h" |
| (...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 428 | 428 |
| 429 EXPECT_EQ(OK, result); | 429 EXPECT_EQ(OK, result); |
| 430 EXPECT_FALSE(proxy_info.is_direct()); | 430 EXPECT_FALSE(proxy_info.is_direct()); |
| 431 EXPECT_EQ("c:100", proxy_info.proxy_server().ToURI()); | 431 EXPECT_EQ("c:100", proxy_info.proxy_server().ToURI()); |
| 432 | 432 |
| 433 // Note that dnsResolve() was never called directly, but it appears | 433 // Note that dnsResolve() was never called directly, but it appears |
| 434 // in the LoadLog. This is because it gets called indirectly by | 434 // in the LoadLog. This is because it gets called indirectly by |
| 435 // isInNet() and isResolvable(). | 435 // isInNet() and isResolvable(). |
| 436 | 436 |
| 437 EXPECT_EQ(6u, log->entries().size()); | 437 EXPECT_EQ(6u, log->entries().size()); |
| 438 ExpectLogContains(log, 0, LoadLog::TYPE_PROXY_RESOLVER_V8_MY_IP_ADDRESS, | 438 EXPECT_TRUE(LogContainsBeginEvent( |
| 439 LoadLog::PHASE_BEGIN); | 439 *log, 0, LoadLog::TYPE_PROXY_RESOLVER_V8_MY_IP_ADDRESS)); |
| 440 ExpectLogContains(log, 1, LoadLog::TYPE_PROXY_RESOLVER_V8_MY_IP_ADDRESS, | 440 EXPECT_TRUE(LogContainsEndEvent( |
| 441 LoadLog::PHASE_END); | 441 *log, 1, LoadLog::TYPE_PROXY_RESOLVER_V8_MY_IP_ADDRESS)); |
| 442 ExpectLogContains(log, 2, LoadLog::TYPE_PROXY_RESOLVER_V8_DNS_RESOLVE, | 442 EXPECT_TRUE(LogContainsBeginEvent( |
| 443 LoadLog::PHASE_BEGIN); | 443 *log, 2, LoadLog::TYPE_PROXY_RESOLVER_V8_DNS_RESOLVE)); |
| 444 ExpectLogContains(log, 3, LoadLog::TYPE_PROXY_RESOLVER_V8_DNS_RESOLVE, | 444 EXPECT_TRUE(LogContainsEndEvent( |
| 445 LoadLog::PHASE_END); | 445 *log, 3, LoadLog::TYPE_PROXY_RESOLVER_V8_DNS_RESOLVE)); |
| 446 ExpectLogContains(log, 4, LoadLog::TYPE_PROXY_RESOLVER_V8_DNS_RESOLVE, | 446 EXPECT_TRUE(LogContainsBeginEvent( |
| 447 LoadLog::PHASE_BEGIN); | 447 *log, 4, LoadLog::TYPE_PROXY_RESOLVER_V8_DNS_RESOLVE)); |
| 448 ExpectLogContains(log, 5, LoadLog::TYPE_PROXY_RESOLVER_V8_DNS_RESOLVE, | 448 EXPECT_TRUE(LogContainsEndEvent( |
| 449 LoadLog::PHASE_END); | 449 *log, 5, LoadLog::TYPE_PROXY_RESOLVER_V8_DNS_RESOLVE)); |
| 450 } | 450 } |
| 451 | 451 |
| 452 // Try loading a PAC script that ends with a comment and has no terminal | 452 // Try loading a PAC script that ends with a comment and has no terminal |
| 453 // newline. This should not cause problems with the PAC utility functions | 453 // newline. This should not cause problems with the PAC utility functions |
| 454 // that we add to the script's environment. | 454 // that we add to the script's environment. |
| 455 // http://crbug.com/22864 | 455 // http://crbug.com/22864 |
| 456 TEST(ProxyResolverV8Test, EndsWithCommentNoNewline) { | 456 TEST(ProxyResolverV8Test, EndsWithCommentNoNewline) { |
| 457 ProxyResolverV8WithMockBindings resolver; | 457 ProxyResolverV8WithMockBindings resolver; |
| 458 int result = resolver.SetPacScriptFromDisk("ends_with_comment.js"); | 458 int result = resolver.SetPacScriptFromDisk("ends_with_comment.js"); |
| 459 EXPECT_EQ(OK, result); | 459 EXPECT_EQ(OK, result); |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 498 ProxyInfo proxy_info; | 498 ProxyInfo proxy_info; |
| 499 result = resolver.GetProxyForURL(kQueryUrl, &proxy_info, NULL, NULL, NULL); | 499 result = resolver.GetProxyForURL(kQueryUrl, &proxy_info, NULL, NULL, NULL); |
| 500 | 500 |
| 501 EXPECT_EQ(OK, result); | 501 EXPECT_EQ(OK, result); |
| 502 EXPECT_FALSE(proxy_info.is_direct()); | 502 EXPECT_FALSE(proxy_info.is_direct()); |
| 503 EXPECT_EQ("success:80", proxy_info.proxy_server().ToURI()); | 503 EXPECT_EQ("success:80", proxy_info.proxy_server().ToURI()); |
| 504 } | 504 } |
| 505 | 505 |
| 506 } // namespace | 506 } // namespace |
| 507 } // namespace net | 507 } // namespace net |
| OLD | NEW |