summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-07 14:18:05 +0000
committerjochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-07 14:18:05 +0000
commit483a3929b79ac8758b5ea882918c32209dbee8aa (patch)
treefd3d16ba8d29e98ac20f7245415a3b468efc228f
parent1d9d8b043222e361a72766b0e160a8261276d6b0 (diff)
downloadchromium_src-483a3929b79ac8758b5ea882918c32209dbee8aa.zip
chromium_src-483a3929b79ac8758b5ea882918c32209dbee8aa.tar.gz
chromium_src-483a3929b79ac8758b5ea882918c32209dbee8aa.tar.bz2
[content shell] return DRT specific strings for certain WebLocalizedStrings check in layout tests
BUG=111316 R=marja@chromium.org TEST=calendar picker tests pass Review URL: https://codereview.chromium.org/12614003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@186712 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--content/shell/shell_content_client.cc44
1 files changed, 44 insertions, 0 deletions
diff --git a/content/shell/shell_content_client.cc b/content/shell/shell_content_client.cc
index 60c91e7..f96b6a3 100644
--- a/content/shell/shell_content_client.cc
+++ b/content/shell/shell_content_client.cc
@@ -6,10 +6,12 @@
#include "base/command_line.h"
#include "base/string_piece.h"
+#include "base/utf_string_conversions.h"
#include "content/public/common/content_switches.h"
#include "content/shell/shell_switches.h"
#include "grit/shell_resources.h"
#include "grit/webkit_resources.h"
+#include "grit/webkit_strings.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
#include "webkit/user_agent/user_agent_util.h"
@@ -28,6 +30,48 @@ std::string ShellContentClient::GetUserAgent() const {
}
string16 ShellContentClient::GetLocalizedString(int message_id) const {
+ if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) {
+ switch (message_id) {
+ case IDS_FORM_VALIDATION_VALUE_MISSING:
+ case IDS_FORM_VALIDATION_VALUE_MISSING_CHECKBOX:
+ case IDS_FORM_VALIDATION_VALUE_MISSING_FILE:
+ case IDS_FORM_VALIDATION_VALUE_MISSING_MULTIPLE_FILE:
+ case IDS_FORM_VALIDATION_VALUE_MISSING_RADIO:
+ case IDS_FORM_VALIDATION_VALUE_MISSING_SELECT:
+ return ASCIIToUTF16("value missing");
+ case IDS_FORM_VALIDATION_TYPE_MISMATCH:
+ case IDS_FORM_VALIDATION_TYPE_MISMATCH_EMAIL:
+ case IDS_FORM_VALIDATION_TYPE_MISMATCH_MULTIPLE_EMAIL:
+ case IDS_FORM_VALIDATION_TYPE_MISMATCH_URL:
+ return ASCIIToUTF16("type mismatch");
+ case IDS_FORM_VALIDATION_PATTERN_MISMATCH:
+ return ASCIIToUTF16("pattern mismatch");
+ case IDS_FORM_VALIDATION_TOO_LONG:
+ return ASCIIToUTF16("too long");
+ case IDS_FORM_VALIDATION_RANGE_UNDERFLOW:
+ return ASCIIToUTF16("range underflow");
+ case IDS_FORM_VALIDATION_RANGE_OVERFLOW:
+ return ASCIIToUTF16("range overflow");
+ case IDS_FORM_VALIDATION_STEP_MISMATCH:
+ return ASCIIToUTF16("step mismatch");
+ case IDS_FORM_OTHER_DATE_LABEL:
+ return ASCIIToUTF16("<<OtherDateLabel>>");
+ case IDS_FORM_OTHER_MONTH_LABEL:
+ return ASCIIToUTF16("<<OtherMonthLabel>>");
+ case IDS_FORM_OTHER_TIME_LABEL:
+ return ASCIIToUTF16("<<OtherTimeLabel>>");
+ case IDS_FORM_OTHER_WEEK_LABEL:
+ return ASCIIToUTF16("<<OtherWeekLabel>>");
+ case IDS_FORM_CALENDAR_CLEAR:
+ return ASCIIToUTF16("<<CalendarClear>>");
+ case IDS_FORM_CALENDAR_TODAY:
+ return ASCIIToUTF16("<<CalendarToday>>");
+ case IDS_FORM_THIS_MONTH_LABEL:
+ return ASCIIToUTF16("<<ThisMonthLabel>>");
+ case IDS_FORM_THIS_WEEK_LABEL:
+ return ASCIIToUTF16("<<ThisWeekLabel>>");
+ }
+ }
return l10n_util::GetStringUTF16(message_id);
}