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 989502b0100b59505e44d91b009e805486c0e7c3..6a9365f646332ca0319d69ef55d333ec464bf9bd 100644 |
| --- a/content/shell/renderer/test_runner/web_test_proxy.cc |
| +++ b/content/shell/renderer/test_runner/web_test_proxy.cc |
| @@ -8,6 +8,7 @@ |
| #include "base/callback_helpers.h" |
| #include "base/debug/trace_event.h" |
| +#include "base/i18n/rtl.h" |
| #include "base/logging.h" |
| #include "base/strings/stringprintf.h" |
| #include "content/shell/renderer/test_runner/MockWebSpeechRecognizer.h" |
| @@ -374,12 +375,32 @@ 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) { |
| + wrapped_main_text = |
| + base::i18n::GetDisplayStringInLTRDirectionality(wrapped_main_text); |
|
jam
2014/08/21 17:32:52
more indent
Habib Virji
2014/08/26 08:55:44
Done.
|
| + } 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); |
|
jam
2014/08/21 17:32:52
ditto
Habib Virji
2014/08/26 08:55:44
Done.
|
| + } 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) { |