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

Unified Diff: net/base/escape_unittest.cc

Issue 10444117: Escape search terms correctly in the path portion of a custom search engine. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 7 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_icu.cc ('k') | net/net.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/escape_unittest.cc
===================================================================
--- net/base/escape_unittest.cc (revision 139570)
+++ net/base/escape_unittest.cc (working copy)
@@ -68,8 +68,7 @@
};
for (size_t i = 0; i < arraysize(escape_cases); ++i) {
EscapeCase value = escape_cases[i];
- EXPECT_EQ(UTF8ToUTF16(value.output),
- EscapeQueryParamValueUTF8(UTF8ToUTF16(value.input), true));
+ EXPECT_EQ(value.output, EscapeQueryParamValue(value.input, true));
}
const EscapeCase escape_cases_no_plus[] = {
@@ -79,8 +78,7 @@
};
for (size_t i = 0; i < arraysize(escape_cases_no_plus); ++i) {
EscapeCase value = escape_cases_no_plus[i];
- EXPECT_EQ(ASCIIToUTF16(value.output),
- EscapeQueryParamValueUTF8(ASCIIToUTF16(value.input), false));
+ EXPECT_EQ(value.output, EscapeQueryParamValue(value.input, false));
}
// Test all the values in we're supposed to be escaping.
@@ -107,21 +105,6 @@
EXPECT_EQ(out, in);
}
}
-
- // Check to see if EscapeQueryParamValueUTF8 is the same as
- // EscapeQueryParamValue(..., kCodepageUTF8,)
- string16 test_str;
- test_str.reserve(5000);
- for (int i = 1; i < 5000; ++i) {
- test_str.push_back(i);
- }
- string16 utf16;
- EXPECT_TRUE(EscapeQueryParamValue(test_str, base::kCodepageUTF8, true,
- &utf16));
- EXPECT_EQ(utf16, EscapeQueryParamValueUTF8(test_str, true));
- EXPECT_TRUE(EscapeQueryParamValue(test_str, base::kCodepageUTF8, false,
- &utf16));
- EXPECT_EQ(utf16, EscapeQueryParamValueUTF8(test_str, false));
}
TEST(EscapeTest, EscapePath) {
« no previous file with comments | « net/base/escape_icu.cc ('k') | net/net.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698