| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |