| 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 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 413 ExpectLogContains(log, 2, LoadLog::TYPE_PROXY_RESOLVER_V8_DNS_RESOLVE, | 413 ExpectLogContains(log, 2, LoadLog::TYPE_PROXY_RESOLVER_V8_DNS_RESOLVE, |
| 414 LoadLog::PHASE_BEGIN); | 414 LoadLog::PHASE_BEGIN); |
| 415 ExpectLogContains(log, 3, LoadLog::TYPE_PROXY_RESOLVER_V8_DNS_RESOLVE, | 415 ExpectLogContains(log, 3, LoadLog::TYPE_PROXY_RESOLVER_V8_DNS_RESOLVE, |
| 416 LoadLog::PHASE_END); | 416 LoadLog::PHASE_END); |
| 417 ExpectLogContains(log, 4, LoadLog::TYPE_PROXY_RESOLVER_V8_DNS_RESOLVE, | 417 ExpectLogContains(log, 4, LoadLog::TYPE_PROXY_RESOLVER_V8_DNS_RESOLVE, |
| 418 LoadLog::PHASE_BEGIN); | 418 LoadLog::PHASE_BEGIN); |
| 419 ExpectLogContains(log, 5, LoadLog::TYPE_PROXY_RESOLVER_V8_DNS_RESOLVE, | 419 ExpectLogContains(log, 5, LoadLog::TYPE_PROXY_RESOLVER_V8_DNS_RESOLVE, |
| 420 LoadLog::PHASE_END); | 420 LoadLog::PHASE_END); |
| 421 } | 421 } |
| 422 | 422 |
| 423 // Try loading a PAC script which ends with a trailing comment (no terminal |
| 424 // newline). This should not cause problems with the PAC utility functions |
| 425 // that we add to the script. |
| 426 // http://crbug.com/22864 |
| 427 TEST(ProxyResolverV8Test, TrailingComment) { |
| 428 ProxyResolverV8WithMockBindings resolver; |
| 429 int result = resolver.SetPacScriptFromDisk("ends_with_comment.js"); |
| 430 EXPECT_EQ(OK, result); |
| 431 |
| 432 ProxyInfo proxy_info; |
| 433 scoped_refptr<LoadLog> log(new LoadLog); |
| 434 result = resolver.GetProxyForURL(kQueryUrl, &proxy_info, NULL, NULL, log); |
| 435 |
| 436 EXPECT_EQ(OK, result); |
| 437 EXPECT_FALSE(proxy_info.is_direct()); |
| 438 EXPECT_EQ("success:80", proxy_info.proxy_server().ToURI()); |
| 439 } |
| 440 |
| 423 } // namespace | 441 } // namespace |
| 424 } // namespace net | 442 } // namespace net |
| OLD | NEW |