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..20b349915f4c31cb133c26333368b3658f5bbc0a 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" |
@@ -323,3 +325,33 @@ TEST_F(TemplateURLFetcherTest, DuplicateDownloadTest) { |
ASSERT_EQ(2, callbacks_destroyed()); |
ASSERT_TRUE(last_callback_template_url()); |
} |
+ |
+TEST_F(TemplateURLFetcherTest, PunycodeTest) { |
+ base::string16 keyword(base::UTF8ToUTF16("яндекс.рф")); |
+ |
+ test_util()->ChangeModelToLoadState(); |
+ ASSERT_FALSE(test_util()->model()->GetTemplateURLForKeyword(keyword)); |
+ |
+ std::string osdd_file_name("punycode_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("яндекс.рф"), t_url->short_name()); |
+} |
+ |
+TEST_F(TemplateURLFetcherTest, UnicodeTest) { |
+ base::string16 keyword(base::UTF8ToUTF16("яндекс.рф")); |
+ |
+ 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("яндекс.рф"), t_url->short_name()); |
+} |