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

Unified Diff: net/base/escape_unittest.cc

Issue 7057053: Escaping file names correctly. Also fixed a crush in chromeos debug build while saving a web page. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Missed fix. Created 9 years, 6 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/base/escape.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/escape_unittest.cc
diff --git a/net/base/escape_unittest.cc b/net/base/escape_unittest.cc
index 5211fdf4e48712b402e0eb8357c560ec4954f90c..90714d4e04cc285f7d3f02bfb3878cf238b5310c 100644
--- a/net/base/escape_unittest.cc
+++ b/net/base/escape_unittest.cc
@@ -147,7 +147,7 @@ TEST(EscapeTest, EscapeUrlEncodedData) {
"\x02\n\x1d !\"#$%&'()*+,-./0123456789:;"
"<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"[\\]^_`abcdefghijklmnopqrstuvwxyz"
- "{|}~\x7f\x80\xff"),
+ "{|}~\x7f\x80\xff", true),
// Escaped
"%02%0A%1D+!%22%23%24%25%26%27()*%2B,-./0123456789:%3B"
"%3C%3D%3E%3F%40ABCDEFGHIJKLMNOPQRSTUVWXYZ"
@@ -155,6 +155,11 @@ TEST(EscapeTest, EscapeUrlEncodedData) {
"%7B%7C%7D~%7F%80%FF");
}
+TEST(EscapeTest, EscapeUrlEncodedDataSpace) {
+ ASSERT_EQ(EscapeUrlEncodedData("a b", true), "a+b");
+ ASSERT_EQ(EscapeUrlEncodedData("a b", false), "a%20b");
+}
+
TEST(EscapeTest, UnescapeURLComponentASCII) {
const UnescapeURLCaseASCII unescape_cases[] = {
{"", UnescapeRule::NORMAL, ""},
« no previous file with comments | « net/base/escape.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698