Index: components/test_runner/text_input_controller.cc |
diff --git a/components/test_runner/text_input_controller.cc b/components/test_runner/text_input_controller.cc |
index cd0aa73b8f394b3e6d7c1649e954ae49c103fd5f..788570bb87e9b0a8d6abebca3c641b7af5ec59fe 100644 |
--- a/components/test_runner/text_input_controller.cc |
+++ b/components/test_runner/text_input_controller.cc |
@@ -283,18 +283,14 @@ |
key_down.windowsKeyCode = 0xE5; // VKEY_PROCESSKEY |
view()->handleInputEvent(key_down); |
- // The value returned by std::string::length() may not correspond to the |
- // actual number of encoded characters in sequences of multi-byte or |
- // variable-length characters. |
- blink::WebString newText = blink::WebString::fromUTF8(text); |
- size_t textLength = newText.length(); |
- |
std::vector<blink::WebCompositionUnderline> underlines; |
- underlines.push_back(blink::WebCompositionUnderline( |
- 0, textLength, SK_ColorBLACK, false, SK_ColorTRANSPARENT)); |
+ underlines.push_back(blink::WebCompositionUnderline(0, text.length(), |
+ SK_ColorBLACK, false, |
+ SK_ColorTRANSPARENT)); |
view()->setComposition( |
- newText, blink::WebVector<blink::WebCompositionUnderline>(underlines), |
- textLength, textLength); |
+ blink::WebString::fromUTF8(text), |
+ blink::WebVector<blink::WebCompositionUnderline>(underlines), |
+ text.length(), text.length()); |
} |
blink::WebView* TextInputController::view() { |