Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(468)

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_aura_unittest.cc

Issue 2912473002: Fix an IME bug where RWHImpl::ImeFinishCompositingText is called twice in a row (Closed)
Patch Set: Change EXPECT_EQ => ASSERT_EQ Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | content/browser/renderer_host/render_widget_host_view_event_handler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/browser/renderer_host/render_widget_host_view_aura.h" 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <tuple> 10 #include <tuple>
(...skipping 1550 matching lines...) Expand 10 before | Expand all | Expand 10 after
1561 sink_->ClearMessages(); 1561 sink_->ClearMessages();
1562 1562
1563 // Simulates the mouse press. 1563 // Simulates the mouse press.
1564 ui::MouseEvent mouse_event(ui::ET_MOUSE_PRESSED, gfx::Point(), gfx::Point(), 1564 ui::MouseEvent mouse_event(ui::ET_MOUSE_PRESSED, gfx::Point(), gfx::Point(),
1565 ui::EventTimeForNow(), ui::EF_LEFT_MOUSE_BUTTON, 1565 ui::EventTimeForNow(), ui::EF_LEFT_MOUSE_BUTTON,
1566 0); 1566 0);
1567 view_->OnMouseEvent(&mouse_event); 1567 view_->OnMouseEvent(&mouse_event);
1568 1568
1569 EXPECT_FALSE(view_->has_composition_text_); 1569 EXPECT_FALSE(view_->has_composition_text_);
1570 1570
1571 EXPECT_EQ(2U, sink_->message_count()); 1571 ASSERT_EQ(2U, sink_->message_count());
1572 1572
1573 if (sink_->message_count() == 2) { 1573 // Verify mouse event happens after the finish composing text event.
1574 // Verify mouse event happens after the finish composing text event. 1574 EXPECT_EQ(InputMsg_ImeFinishComposingText::ID,
1575 EXPECT_EQ(InputMsg_ImeFinishComposingText::ID, 1575 sink_->GetMessageAt(0)->type());
1576 sink_->GetMessageAt(0)->type()); 1576 EXPECT_EQ(InputMsg_HandleInputEvent::ID, sink_->GetMessageAt(1)->type());
1577 EXPECT_EQ(InputMsg_HandleInputEvent::ID,
1578 sink_->GetMessageAt(1)->type());
1579 }
1580 } 1577 }
1581 1578
1582 // Checks that touch-event state is maintained correctly. 1579 // Checks that touch-event state is maintained correctly.
1583 TEST_F(RenderWidgetHostViewAuraRafAlignedTouchDisabledTest, TouchEventState) { 1580 TEST_F(RenderWidgetHostViewAuraRafAlignedTouchDisabledTest, TouchEventState) {
1584 view_->InitAsChild(nullptr); 1581 view_->InitAsChild(nullptr);
1585 view_->Show(); 1582 view_->Show();
1586 GetSentMessageCountAndResetSink(); 1583 GetSentMessageCountAndResetSink();
1587 1584
1588 // Start with no touch-event handler in the renderer. 1585 // Start with no touch-event handler in the renderer.
1589 widget_host_->OnMessageReceived(ViewHostMsg_HasTouchEventHandlers(0, false)); 1586 widget_host_->OnMessageReceived(ViewHostMsg_HasTouchEventHandlers(0, false));
(...skipping 4245 matching lines...) Expand 10 before | Expand all | Expand 10 after
5835 // There is no composition in the beginning. 5832 // There is no composition in the beginning.
5836 EXPECT_FALSE(has_composition_text()); 5833 EXPECT_FALSE(has_composition_text());
5837 SetHasCompositionTextToTrue(); 5834 SetHasCompositionTextToTrue();
5838 view->ImeCancelComposition(); 5835 view->ImeCancelComposition();
5839 // The composition must have been canceled. 5836 // The composition must have been canceled.
5840 EXPECT_FALSE(has_composition_text()); 5837 EXPECT_FALSE(has_composition_text());
5841 } 5838 }
5842 } 5839 }
5843 5840
5844 } // namespace content 5841 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/renderer_host/render_widget_host_view_event_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698