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

Unified Diff: chrome/browser/chromeos/drive/search_metadata_unittest.cc

Issue 15945004: Case-insensitive search for non-ASCII characters in auto-complete of Drive files. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review fix. Created 7 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 | « chrome/browser/chromeos/drive/search_metadata.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/drive/search_metadata_unittest.cc
diff --git a/chrome/browser/chromeos/drive/search_metadata_unittest.cc b/chrome/browser/chromeos/drive/search_metadata_unittest.cc
index 3730f64286e17d3b81976805682e872d77b04dd2..ec892ffae034f1460fa9735a277ba00ee6cd5196 100644
--- a/chrome/browser/chromeos/drive/search_metadata_unittest.cc
+++ b/chrome/browser/chromeos/drive/search_metadata_unittest.cc
@@ -42,7 +42,7 @@ class MetadataInfoGenerator {
}
// Obtains the fake last accessed time that is sequential number following
- // |last_accessed_base| specified at the construcor.
+ // |last_accessed_base| specified at the constructor.
int64 GetLastAccessed() const {
return last_accessed_counter_;
}
@@ -574,7 +574,8 @@ TEST(SearchMetadataSimpleTest, FindAndHighlight_InTheMiddle) {
TEST(SearchMetadataSimpleTest, FindAndHighlight_MultipeMatches) {
std::string highlighted_text;
EXPECT_TRUE(FindAndHighlight("yoyoyoyoy", "yoy", &highlighted_text));
- EXPECT_EQ("<b>yoy</b>o<b>yoy</b>oy", highlighted_text);
+ // Only the first match is highlighted.
+ EXPECT_EQ("<b>yoy</b>oyoyoy", highlighted_text);
}
TEST(SearchMetadataSimpleTest, FindAndHighlight_IgnoreCase) {
@@ -583,6 +584,28 @@ TEST(SearchMetadataSimpleTest, FindAndHighlight_IgnoreCase) {
EXPECT_EQ("<b>HeLLo</b>", highlighted_text);
}
+TEST(SearchMetadataSimpleTest, FindAndHighlight_IgnoreCaseNonASCII) {
+ std::string highlighted_text;
+
+ // Case and accent ignorance in Greek. Find "socra" in "Socra'tes".
+ EXPECT_TRUE(FindAndHighlight(
+ "\xCE\xA3\xCF\x89\xCE\xBA\xCF\x81\xCE\xAC\xCF\x84\xCE\xB7\xCF\x82",
+ "\xCF\x83\xCF\x89\xCE\xBA\xCF\x81\xCE\xB1", &highlighted_text));
+ EXPECT_EQ(
+ "<b>\xCE\xA3\xCF\x89\xCE\xBA\xCF\x81\xCE\xAC</b>\xCF\x84\xCE\xB7\xCF\x82",
+ highlighted_text);
+
+ // In Japanese characters.
+ // Find Hiragana "pi" + "(small)ya" in Katakana "hi" + semi-voiced-mark + "ya"
+ EXPECT_TRUE(FindAndHighlight(
+ "\xE3\x81\xB2\xE3\x82\x9A\xE3\x82\x83\xE3\x83\xBC",
+ "\xE3\x83\x94\xE3\x83\xA4",
+ &highlighted_text));
+ EXPECT_EQ(
+ "<b>\xE3\x81\xB2\xE3\x82\x9A\xE3\x82\x83</b>\xE3\x83\xBC",
+ highlighted_text);
+}
+
TEST(SearchMetadataSimpleTest, FindAndHighlight_MetaChars) {
std::string highlighted_text;
EXPECT_TRUE(FindAndHighlight("<hello>", "hello", &highlighted_text));
« no previous file with comments | « chrome/browser/chromeos/drive/search_metadata.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698