| Index: content/renderer/render_view_browsertest.cc
|
| diff --git a/content/renderer/render_view_browsertest.cc b/content/renderer/render_view_browsertest.cc
|
| index b7af1d0db0f36852c73d9f52d05a7e277316a882..af262b9ea7ddd9cdc8555968d1d53b7e1c33523b 100644
|
| --- a/content/renderer/render_view_browsertest.cc
|
| +++ b/content/renderer/render_view_browsertest.cc
|
| @@ -1727,27 +1727,24 @@ TEST_F(RenderViewImplTest, MessageOrderInDidChangeSelection) {
|
| view()->SetHandlingInputEventForTesting(true);
|
| ExecuteJavaScriptForTests("document.getElementById('test').focus();");
|
|
|
| - bool is_input_type_called = false;
|
| - bool is_selection_called = false;
|
| - size_t last_input_type = 0;
|
| - size_t last_selection = 0;
|
| + int first_input_type = -1;
|
| + int first_selection = -1;
|
|
|
| for (size_t i = 0; i < render_thread_->sink().message_count(); ++i) {
|
| const uint32_t type = render_thread_->sink().GetMessageAt(i)->type();
|
| if (type == ViewHostMsg_TextInputStateChanged::ID) {
|
| - is_input_type_called = true;
|
| - last_input_type = i;
|
| + if (first_input_type == -1)
|
| + first_input_type = static_cast<int>(i);
|
| } else if (type == FrameHostMsg_SelectionChanged::ID) {
|
| - is_selection_called = true;
|
| - last_selection = i;
|
| + if (first_selection == -1)
|
| + first_selection = static_cast<int>(i);
|
| }
|
| }
|
|
|
| - EXPECT_TRUE(is_input_type_called);
|
| - EXPECT_TRUE(is_selection_called);
|
| -
|
| - // InputTypeChange shold be called earlier than SelectionChanged.
|
| - EXPECT_LT(last_input_type, last_selection);
|
| + EXPECT_NE(first_input_type, -1);
|
| + EXPECT_NE(first_selection, -1);
|
| + // InputTypeChange should be called earlier than SelectionChanged.
|
| + EXPECT_LT(first_input_type, first_selection);
|
| }
|
|
|
| class RendererErrorPageTest : public RenderViewImplTest {
|
|
|