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

Unified Diff: chrome/renderer/translate_helper_browsertest.cc

Issue 11358121: support common content-language mistakes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: improved test name Created 8 years, 1 month 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/renderer/translate_helper.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/translate_helper_browsertest.cc
diff --git a/chrome/renderer/translate_helper_browsertest.cc b/chrome/renderer/translate_helper_browsertest.cc
index a88855e603d45b86bee63c4affe24d23e1b7c26b..b469f2436bb16a568909a7d91a136fe51ee6b50d 100644
--- a/chrome/renderer/translate_helper_browsertest.cc
+++ b/chrome/renderer/translate_helper_browsertest.cc
@@ -395,6 +395,25 @@ TEST_F(ChromeRenderViewTest, LanguageMetaTagCase) {
EXPECT_EQ("fr", params.a);
}
+// Tests that the language meta tag is converted to Chrome standard of dashes
+// instead of underscores and proper capitalization.
+// http://code.google.com/p/chromium/issues/detail?id=159487
+TEST_F(ChromeRenderViewTest, LanguageCommonMistakesAreCorrected) {
+ // Suppress the normal delay that occurs when the page is loaded before which
+ // the renderer sends the page contents to the browser.
+ SendContentStateImmediately();
+
+ LoadHTML("<html><head><meta http-equiv='Content-Language' content='EN_us'>"
+ "</head><body>A random page with random content.</body></html>");
+ const IPC::Message* message = render_thread_->sink().GetUniqueMessageMatching(
+ ChromeViewHostMsg_TranslateLanguageDetermined::ID);
+ ASSERT_NE(static_cast<IPC::Message*>(NULL), message);
+ ChromeViewHostMsg_TranslateLanguageDetermined::Param params;
+ ChromeViewHostMsg_TranslateLanguageDetermined::Read(message, &params);
+ EXPECT_EQ("en-US", params.a);
+ render_thread_->sink().ClearMessages();
+}
+
// Tests that a back navigation gets a translate language message.
TEST_F(ChromeRenderViewTest, BackToTranslatablePage) {
« no previous file with comments | « chrome/renderer/translate_helper.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698