diff options
author | hbono@chromium.org <hbono@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-15 04:38:19 +0000 |
---|---|---|
committer | hbono@chromium.org <hbono@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-15 04:38:19 +0000 |
commit | d0d6cb27de051568fc35c6a3ffcbea43f1a5952c (patch) | |
tree | 6b0af3b5c47c3d7055bab89ba87bb13908372a6e | |
parent | ff3a36d25403f4c0b92948846dd0332bbc539ef6 (diff) | |
download | chromium_src-d0d6cb27de051568fc35c6a3ffcbea43f1a5952c.zip chromium_src-d0d6cb27de051568fc35c6a3ffcbea43f1a5952c.tar.gz chromium_src-d0d6cb27de051568fc35c6a3ffcbea43f1a5952c.tar.bz2 |
Fix hyphen-locale.html and hyphenate-limit-lines.html.
Even though I have implemented hyphenation for DumpRenderTree, a couple of layout tests still fail on Chromium DumpRenderTree due to the following reasons:
* hyphen-locale.html uses "en" and "en_GB" for the hyphenation locale, and;
* hyphenate-limit-lines.html uses capitalized words.
To fix these tests, this change supports these locales and capitalized words.
BUG=140490
TEST=hyphen-locale.html and hyphenate-limit-lines.html
Review URL: https://chromiumcodereview.appspot.com/11112011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@161825 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | webkit/support/test_webkit_platform_support.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/webkit/support/test_webkit_platform_support.cc b/webkit/support/test_webkit_platform_support.cc index 6fd34f3..fc82fab 100644 --- a/webkit/support/test_webkit_platform_support.cc +++ b/webkit/support/test_webkit_platform_support.cc @@ -502,7 +502,8 @@ TestWebKitPlatformSupport::createRTCPeerConnectionHandler( } bool TestWebKitPlatformSupport::canHyphenate(const WebKit::WebString& locale) { - return locale.isEmpty() || locale.equals("en_US"); + return locale.isEmpty() || locale.equals("en") || locale.equals("en_US") || + locale.equals("en_GB"); } size_t TestWebKitPlatformSupport::computeLastHyphenLocation( @@ -510,7 +511,8 @@ size_t TestWebKitPlatformSupport::computeLastHyphenLocation( size_t length, size_t before_index, const WebKit::WebString& locale) { - DCHECK(locale.isEmpty() || locale.equals("en_US")); + DCHECK(locale.isEmpty() || locale.equals("en") || locale.equals("en_US") || + locale.equals("en_GB")); if (!hyphen_dictionary_) { // Initialize the hyphen library with a sample dictionary. To avoid test // flakiness, this code synchronously loads the dictionary. @@ -535,7 +537,7 @@ size_t TestWebKitPlatformSupport::computeLastHyphenLocation( string16 word_utf16(characters, length); if (!IsStringASCII(word_utf16)) return 0; - std::string word = UTF16ToASCII(word_utf16); + std::string word = StringToLowerASCII(UTF16ToASCII(word_utf16)); scoped_array<char> hyphens(new char[word.length() + 5]); char** rep = NULL; int* pos = NULL; |