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

Side by Side Diff: webkit/support/test_webkit_platform_support.cc

Issue 11141021: Add string localization test mode Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 2 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "webkit/support/test_webkit_platform_support.h" 5 #include "webkit/support/test_webkit_platform_support.h"
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/metrics/stats_counters.h" 8 #include "base/metrics/stats_counters.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "base/scoped_temp_dir.h" 10 #include "base/scoped_temp_dir.h"
11 #include "base/string_util.h" 11 #include "base/string_util.h"
12 #include "base/string_number_conversions.h"
12 #include "base/utf_string_conversions.h" 13 #include "base/utf_string_conversions.h"
13 #include "media/base/media.h" 14 #include "media/base/media.h"
14 #include "net/cookies/cookie_monster.h" 15 #include "net/cookies/cookie_monster.h"
15 #include "net/http/http_cache.h" 16 #include "net/http/http_cache.h"
16 #include "net/test/test_server.h" 17 #include "net/test/test_server.h"
17 #include "third_party/hyphen/hyphen.h" 18 #include "third_party/hyphen/hyphen.h"
18 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebAudioDevi ce.h" 19 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebAudioDevi ce.h"
19 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebData.h" 20 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebData.h"
20 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDatabase.h" 21 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDatabase.h"
21 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebFileSyste m.h" 22 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebFileSyste m.h"
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 "\x18\x50\xb9\x33\x47\xf9\xa8\x01\x32\xd4\xc2\x03\x00\x33\x84\x0d" 260 "\x18\x50\xb9\x33\x47\xf9\xa8\x01\x32\xd4\xc2\x03\x00\x33\x84\x0d"
260 "\x02\x3a\x91\xeb\xa5\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60" 261 "\x02\x3a\x91\xeb\xa5\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60"
261 "\x82"; 262 "\x82";
262 return WebKit::WebData(red_square, arraysize(red_square)); 263 return WebKit::WebData(red_square, arraysize(red_square));
263 } 264 }
264 return webkit_glue::WebKitPlatformSupportImpl::loadResource(name); 265 return webkit_glue::WebKitPlatformSupportImpl::loadResource(name);
265 } 266 }
266 267
267 WebKit::WebString TestWebKitPlatformSupport::queryLocalizedString( 268 WebKit::WebString TestWebKitPlatformSupport::queryLocalizedString(
268 WebKit::WebLocalizedString::Name name) { 269 WebKit::WebLocalizedString::Name name) {
270 if (WebKit::WebRuntimeFeatures::isStringLocalizationTestModeEnabled())
271 return base::IntToString16(name);
269 // Returns messages same as WebKit's in DRT. 272 // Returns messages same as WebKit's in DRT.
270 // We use different strings for form validation messages. 273 // We use different strings for form validation messages.
271 switch (name) { 274 switch (name) {
272 case WebKit::WebLocalizedString::ValidationValueMissing: 275 case WebKit::WebLocalizedString::ValidationValueMissing:
273 case WebKit::WebLocalizedString::ValidationValueMissingForCheckbox: 276 case WebKit::WebLocalizedString::ValidationValueMissingForCheckbox:
274 case WebKit::WebLocalizedString::ValidationValueMissingForFile: 277 case WebKit::WebLocalizedString::ValidationValueMissingForFile:
275 case WebKit::WebLocalizedString::ValidationValueMissingForMultipleFile: 278 case WebKit::WebLocalizedString::ValidationValueMissingForMultipleFile:
276 case WebKit::WebLocalizedString::ValidationValueMissingForRadio: 279 case WebKit::WebLocalizedString::ValidationValueMissingForRadio:
277 case WebKit::WebLocalizedString::ValidationValueMissingForSelect: 280 case WebKit::WebLocalizedString::ValidationValueMissingForSelect:
278 return ASCIIToUTF16("value missing"); 281 return ASCIIToUTF16("value missing");
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
568 // Retrieve the last position where we can insert a hyphen before the given 571 // Retrieve the last position where we can insert a hyphen before the given
569 // index. 572 // index.
570 if (before_index >= 2) { 573 if (before_index >= 2) {
571 for (size_t index = before_index - 2; index > 0; --index) { 574 for (size_t index = before_index - 2; index > 0; --index) {
572 if (hyphens[index] & 1) 575 if (hyphens[index] & 1)
573 return index + 1; 576 return index + 1;
574 } 577 }
575 } 578 }
576 return 0; 579 return 0;
577 } 580 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698