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

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: remove unnecessary braces 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..850956153bcab21a25945b4abd7e890f33baa912 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
James Hawkins 2012/11/06 18:47:49 re: chrome standard - Is this just Chrome's interp
bcwhite 2012/11/06 18:55:23 As far as I could find, dashes are the official wa
+// instead of underscores and proper capitalization.
+// http://code.google.com/p/chromium/issues/detail?id=159487
+TEST_F(ChromeRenderViewTest, LanguageFormatCorrect) {
James Hawkins 2012/11/06 18:47:49 nit: Please use a more precise test name.
bcwhite 2012/11/06 18:55:23 Done.
+ // 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