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

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: Modified the Test Created 3 years, 7 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 1562 matching lines...) Expand 10 before | Expand all | Expand 10 after
1573 // Simulates the mouse press. 1573 // Simulates the mouse press.
1574 ui::MouseEvent mouse_event(ui::ET_MOUSE_PRESSED, gfx::Point(), gfx::Point(), 1574 ui::MouseEvent mouse_event(ui::ET_MOUSE_PRESSED, gfx::Point(), gfx::Point(),
1575 ui::EventTimeForNow(), ui::EF_LEFT_MOUSE_BUTTON, 1575 ui::EventTimeForNow(), ui::EF_LEFT_MOUSE_BUTTON,
1576 0); 1576 0);
1577 view_->OnMouseEvent(&mouse_event); 1577 view_->OnMouseEvent(&mouse_event);
1578 1578
1579 EXPECT_FALSE(view_->has_composition_text_); 1579 EXPECT_FALSE(view_->has_composition_text_);
1580 1580
1581 EXPECT_EQ(2U, sink_->message_count()); 1581 EXPECT_EQ(2U, sink_->message_count());
1582 1582
1583 if (sink_->message_count() == 2) { 1583 // Verify mouse event happens after the finish composing text event.
1584 // Verify mouse event happens after the finish composing text event. 1584 EXPECT_EQ(InputMsg_ImeFinishComposingText::ID,
sadrul 2017/05/30 21:03:03 ASSERT that sink_->message_count() >= 2 before acc
Shu Chen 2017/05/31 01:16:36 +1. Can we assert message_count == 2? Or can we ch
EhsanK 2017/05/31 13:48:24 Thanks! Changed the EXPECT on line 1581 into ASSER
1585 EXPECT_EQ(InputMsg_ImeFinishComposingText::ID, 1585 sink_->GetMessageAt(0)->type());
1586 sink_->GetMessageAt(0)->type()); 1586 EXPECT_EQ(InputMsg_HandleInputEvent::ID, sink_->GetMessageAt(1)->type());
1587 EXPECT_EQ(InputMsg_HandleInputEvent::ID,
1588 sink_->GetMessageAt(1)->type());
1589 }
1590 } 1587 }
1591 1588
1592 // Checks that touch-event state is maintained correctly. 1589 // Checks that touch-event state is maintained correctly.
1593 TEST_F(RenderWidgetHostViewAuraRafAlignedTouchDisabledTest, TouchEventState) { 1590 TEST_F(RenderWidgetHostViewAuraRafAlignedTouchDisabledTest, TouchEventState) {
1594 view_->InitAsChild(nullptr); 1591 view_->InitAsChild(nullptr);
1595 view_->Show(); 1592 view_->Show();
1596 GetSentMessageCountAndResetSink(); 1593 GetSentMessageCountAndResetSink();
1597 1594
1598 // Start with no touch-event handler in the renderer. 1595 // Start with no touch-event handler in the renderer.
1599 widget_host_->OnMessageReceived(ViewHostMsg_HasTouchEventHandlers(0, false)); 1596 widget_host_->OnMessageReceived(ViewHostMsg_HasTouchEventHandlers(0, false));
(...skipping 4292 matching lines...) Expand 10 before | Expand all | Expand 10 after
5892 // There is no composition in the beginning. 5889 // There is no composition in the beginning.
5893 EXPECT_FALSE(has_composition_text()); 5890 EXPECT_FALSE(has_composition_text());
5894 SetHasCompositionTextToTrue(); 5891 SetHasCompositionTextToTrue();
5895 view->ImeCancelComposition(); 5892 view->ImeCancelComposition();
5896 // The composition must have been canceled. 5893 // The composition must have been canceled.
5897 EXPECT_FALSE(has_composition_text()); 5894 EXPECT_FALSE(has_composition_text());
5898 } 5895 }
5899 } 5896 }
5900 5897
5901 } // namespace content 5898 } // 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