OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "components/test_runner/web_view_test_client.h" | 5 #include "components/test_runner/web_view_test_client.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/i18n/rtl.h" | 9 #include "base/i18n/rtl.h" |
10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 frame->printBegin(printParams); | 102 frame->printBegin(printParams); |
103 frame->printEnd(); | 103 frame->printEnd(); |
104 } | 104 } |
105 | 105 |
106 void WebViewTestClient::showValidationMessage( | 106 void WebViewTestClient::showValidationMessage( |
107 const blink::WebRect& anchor_in_root_view, | 107 const blink::WebRect& anchor_in_root_view, |
108 const blink::WebString& main_message, | 108 const blink::WebString& main_message, |
109 blink::WebTextDirection main_message_hint, | 109 blink::WebTextDirection main_message_hint, |
110 const blink::WebString& sub_message, | 110 const blink::WebString& sub_message, |
111 blink::WebTextDirection sub_message_hint) { | 111 blink::WebTextDirection sub_message_hint) { |
| 112 if (test_runner_->is_web_platform_tests_mode()) |
| 113 return; |
| 114 |
112 base::string16 wrapped_main_text = main_message; | 115 base::string16 wrapped_main_text = main_message; |
113 base::string16 wrapped_sub_text = sub_message; | 116 base::string16 wrapped_sub_text = sub_message; |
114 | 117 |
115 if (main_message_hint == blink::WebTextDirectionLeftToRight) { | 118 if (main_message_hint == blink::WebTextDirectionLeftToRight) { |
116 wrapped_main_text = | 119 wrapped_main_text = |
117 base::i18n::GetDisplayStringInLTRDirectionality(wrapped_main_text); | 120 base::i18n::GetDisplayStringInLTRDirectionality(wrapped_main_text); |
118 } else if (main_message_hint == blink::WebTextDirectionRightToLeft && | 121 } else if (main_message_hint == blink::WebTextDirectionRightToLeft && |
119 !base::i18n::IsRTL()) { | 122 !base::i18n::IsRTL()) { |
120 base::i18n::WrapStringWithRTLFormatting(&wrapped_main_text); | 123 base::i18n::WrapStringWithRTLFormatting(&wrapped_main_text); |
121 } | 124 } |
(...skipping 22 matching lines...) Expand all Loading... |
144 | 147 |
145 WebTestDelegate* WebViewTestClient::delegate() { | 148 WebTestDelegate* WebViewTestClient::delegate() { |
146 return web_view_test_proxy_base_->delegate(); | 149 return web_view_test_proxy_base_->delegate(); |
147 } | 150 } |
148 | 151 |
149 void WebViewTestClient::didFocus() { | 152 void WebViewTestClient::didFocus() { |
150 test_runner_->SetFocus(web_view_test_proxy_base_->web_view(), true); | 153 test_runner_->SetFocus(web_view_test_proxy_base_->web_view(), true); |
151 } | 154 } |
152 | 155 |
153 } // namespace test_runner | 156 } // namespace test_runner |
OLD | NEW |