Chromium Code Reviews| Index: content/shell/renderer/test_runner/web_test_proxy.cc |
| diff --git a/content/shell/renderer/test_runner/web_test_proxy.cc b/content/shell/renderer/test_runner/web_test_proxy.cc |
| index 270f990ec7876cfd7b79f9d226cb383ef331d8a5..ce511970b84dc47633a3e8f578f0af8011351fbf 100644 |
| --- a/content/shell/renderer/test_runner/web_test_proxy.cc |
| +++ b/content/shell/renderer/test_runner/web_test_proxy.cc |
| @@ -8,7 +8,9 @@ |
| #include "base/callback_helpers.h" |
| #include "base/debug/trace_event.h" |
| +#include "base/i18n/rtl.h" |
| #include "base/logging.h" |
| +#include "base/strings/utf_string_conversions.h" |
| #include "content/shell/renderer/test_runner/MockColorChooser.h" |
| #include "content/shell/renderer/test_runner/MockWebSpeechRecognizer.h" |
| #include "content/shell/renderer/test_runner/SpellCheckClient.h" |
| @@ -377,12 +379,30 @@ bool WebTestProxyBase::RunFileChooser( |
| void WebTestProxyBase::ShowValidationMessage( |
| const blink::WebRect& anchor_in_root_view, |
| const blink::WebString& message, |
| + blink::WebTextDirection message_dir, |
| const blink::WebString& sub_message, |
| - blink::WebTextDirection hint) { |
| + blink::WebTextDirection sub_message_dir) { |
| + base::string16 wrapped_main_text = message; |
| + base::string16 wrapped_sub_text = sub_message; |
| + |
| + if (message_dir == blink::WebTextDirectionLeftToRight) |
|
jam
2014/08/18 17:55:51
nit: need brace brackets
Habib Virji
2014/08/20 09:15:55
Done.
|
| + wrapped_main_text = |
| + base::i18n::GetDisplayStringInLTRDirectionality(wrapped_main_text); |
| + else if (message_dir == blink::WebTextDirectionRightToLeft) |
| + base::i18n::WrapStringWithRTLFormatting(&wrapped_main_text); |
| + |
| + if (!wrapped_sub_text.empty()) { |
| + if (sub_message_dir == blink::WebTextDirectionLeftToRight) |
| + wrapped_sub_text = |
| + base::i18n::GetDisplayStringInLTRDirectionality(wrapped_sub_text); |
| + else if (sub_message_dir == blink::WebTextDirectionRightToLeft) |
| + base::i18n::WrapStringWithRTLFormatting(&wrapped_sub_text); |
| + } |
| delegate_->printMessage( |
| - std::string("ValidationMessageClient: main-message=") + |
| - std::string(message.utf8()) + " sub-message=" + |
| - std::string(sub_message.utf8()) + "\n"); |
| + "ValidationMessageClient: main-message=" + |
| + base::UTF16ToUTF8(wrapped_main_text) + |
| + " sub-message=" + |
| + base::UTF16ToUTF8(wrapped_sub_text) + "\n"); |
| } |
| std::string WebTestProxyBase::CaptureTree(bool debug_render_tree) { |