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

Unified Diff: components/search_engines/template_url_fetcher_unittest.cc

Issue 1238683003: Unpunycode search keywords and short names. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Fix grammar. Created 5 years, 5 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 | « components/search_engines/template_url.cc ('k') | components/search_engines/template_url_parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/search_engines/template_url_fetcher_unittest.cc
diff --git a/components/search_engines/template_url_fetcher_unittest.cc b/components/search_engines/template_url_fetcher_unittest.cc
index d69f57d153ad7bcb9bc19812615beee82fe1ef90..6eb5a43641c165cc43cfb80e5aa66814b1778499 100644
--- a/components/search_engines/template_url_fetcher_unittest.cc
+++ b/components/search_engines/template_url_fetcher_unittest.cc
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <string>
+
#include "base/callback_helpers.h"
#include "base/files/file_util.h"
#include "base/memory/scoped_ptr.h"
@@ -181,6 +183,7 @@ TEST_F(TemplateURLFetcherTest, BasicAutodetectedTest) {
EXPECT_EQ(ASCIIToUTF16("http://example.com/%s/other_stuff"),
t_url->url_ref().DisplayURL(
test_util()->model()->search_terms_data()));
+ EXPECT_EQ(ASCIIToUTF16("Simple Search"), t_url->short_name());
EXPECT_TRUE(t_url->safe_for_autoreplace());
}
@@ -323,3 +326,19 @@ TEST_F(TemplateURLFetcherTest, DuplicateDownloadTest) {
ASSERT_EQ(2, callbacks_destroyed());
ASSERT_TRUE(last_callback_template_url());
}
+
+TEST_F(TemplateURLFetcherTest, UnicodeTest) {
+ base::string16 keyword(ASCIIToUTF16("test"));
+
+ test_util()->ChangeModelToLoadState();
+ ASSERT_FALSE(test_util()->model()->GetTemplateURLForKeyword(keyword));
+
+ std::string osdd_file_name("unicode_open_search.xml");
+ StartDownload(keyword, osdd_file_name,
+ TemplateURLFetcher::AUTODETECTED_PROVIDER, true);
+ WaitForDownloadToFinish();
+ const TemplateURL* t_url =
+ test_util()->model()->GetTemplateURLForKeyword(keyword);
+ EXPECT_EQ(base::UTF8ToUTF16("\xd1\x82\xd0\xb5\xd1\x81\xd1\x82"),
+ t_url->short_name());
+}
« no previous file with comments | « components/search_engines/template_url.cc ('k') | components/search_engines/template_url_parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698