Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1091)

Unified Diff: net/proxy/proxy_resolver_v8_unittest.cc

Issue 238004: Add an additional unit-test for when PAC script is missing newline.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: reword a comment Created 11 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/data/proxy_resolver_v8_unittest/ends_with_statement_no_semicolon.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/proxy/proxy_resolver_v8_unittest.cc
===================================================================
--- net/proxy/proxy_resolver_v8_unittest.cc (revision 27049)
+++ net/proxy/proxy_resolver_v8_unittest.cc (working copy)
@@ -420,11 +420,11 @@
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 @@
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
« no previous file with comments | « net/data/proxy_resolver_v8_unittest/ends_with_statement_no_semicolon.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698