summaryrefslogtreecommitdiffstats
path: root/net/proxy
diff options
context:
space:
mode:
authoreroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-25 04:52:39 +0000
committereroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-25 04:52:39 +0000
commitcd88b0c7cac088f6607b82a9d472a89c2108b893 (patch)
tree48a9db5a5a114ee5e921d906a579992f5818650c /net/proxy
parent237a44a37de4fb8ef9e868d2b8746737c25282a6 (diff)
downloadchromium_src-cd88b0c7cac088f6607b82a9d472a89c2108b893.zip
chromium_src-cd88b0c7cac088f6607b82a9d472a89c2108b893.tar.gz
chromium_src-cd88b0c7cac088f6607b82a9d472a89c2108b893.tar.bz2
Add an additional unit-test for when PAC script is missing newline.
This variation uses a statement without semi-colon, rather than a comment, as the last line. BUG=http://crbug.com/22864 Review URL: http://codereview.chromium.org/238004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27171 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/proxy')
-rw-r--r--net/proxy/proxy_resolver_v8_unittest.cc27
1 files changed, 23 insertions, 4 deletions
diff --git a/net/proxy/proxy_resolver_v8_unittest.cc b/net/proxy/proxy_resolver_v8_unittest.cc
index de6ea5c..e37e643 100644
--- a/net/proxy/proxy_resolver_v8_unittest.cc
+++ b/net/proxy/proxy_resolver_v8_unittest.cc
@@ -420,11 +420,11 @@ TEST(ProxyResolverV8Test, LoadLog) {
LoadLog::PHASE_END);
}
-// Try loading a PAC script which ends with a trailing comment (no terminal
-// newline). This should not cause problems with the PAC utility functions
-// that we add to the script.
+// Try loading a PAC script that ends with a comment and has no terminal
+// newline. This should not cause problems with the PAC utility functions
+// that we add to the script's environment.
// http://crbug.com/22864
-TEST(ProxyResolverV8Test, TrailingComment) {
+TEST(ProxyResolverV8Test, EndsWithCommentNoNewline) {
ProxyResolverV8WithMockBindings resolver;
int result = resolver.SetPacScriptFromDisk("ends_with_comment.js");
EXPECT_EQ(OK, result);
@@ -438,5 +438,24 @@ TEST(ProxyResolverV8Test, TrailingComment) {
EXPECT_EQ("success:80", proxy_info.proxy_server().ToURI());
}
+// Try loading a PAC script that ends with a statement and has no terminal
+// newline. This should not cause problems with the PAC utility functions
+// that we add to the script's environment.
+// http://crbug.com/22864
+TEST(ProxyResolverV8Test, EndsWithStatementNoNewline) {
+ ProxyResolverV8WithMockBindings resolver;
+ int result = resolver.SetPacScriptFromDisk(
+ "ends_with_statement_no_semicolon.js");
+ EXPECT_EQ(OK, result);
+
+ ProxyInfo proxy_info;
+ scoped_refptr<LoadLog> log(new LoadLog);
+ result = resolver.GetProxyForURL(kQueryUrl, &proxy_info, NULL, NULL, log);
+
+ EXPECT_EQ(OK, result);
+ EXPECT_FALSE(proxy_info.is_direct());
+ EXPECT_EQ("success:3", proxy_info.proxy_server().ToURI());
+}
+
} // namespace
} // namespace net