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 "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/memory/scoped_vector.h" | 9 #include "base/memory/scoped_vector.h" |
10 #include "base/memory/shared_memory.h" | 10 #include "base/memory/shared_memory.h" |
(...skipping 1064 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1075 ui::CompositionUnderline(3, 4, 0xff000000, false, 0xefcdab90)); | 1075 ui::CompositionUnderline(3, 4, 0xff000000, false, 0xefcdab90)); |
1076 | 1076 |
1077 // Caret is at the end. (This emulates Japanese MSIME 2007 and later) | 1077 // Caret is at the end. (This emulates Japanese MSIME 2007 and later) |
1078 composition_text.selection = gfx::Range(4); | 1078 composition_text.selection = gfx::Range(4); |
1079 | 1079 |
1080 view_->SetCompositionText(composition_text); | 1080 view_->SetCompositionText(composition_text); |
1081 EXPECT_TRUE(view_->has_composition_text_); | 1081 EXPECT_TRUE(view_->has_composition_text_); |
1082 sink_->ClearMessages(); | 1082 sink_->ClearMessages(); |
1083 | 1083 |
1084 // Simulates the mouse press. | 1084 // Simulates the mouse press. |
1085 ui::MouseEvent mouse_event(ui::ET_MOUSE_PRESSED, gfx::Point(), gfx::Point(), | 1085 ui::MouseEvent mouse_event( |
1086 ui::EventTimeForNow(), ui::EF_LEFT_MOUSE_BUTTON, | 1086 ui::ET_MOUSE_PRESSED, gfx::Point(), gfx::Point(), ui::EventTimeForNow(), |
1087 0); | 1087 ui::EF_LEFT_MOUSE_BUTTON, 0, |
| 1088 ui::PointerEventDetails(ui::EventPointerType::POINTER_TYPE_MOUSE)); |
1088 view_->OnMouseEvent(&mouse_event); | 1089 view_->OnMouseEvent(&mouse_event); |
1089 | 1090 |
1090 EXPECT_FALSE(view_->has_composition_text_); | 1091 EXPECT_FALSE(view_->has_composition_text_); |
1091 | 1092 |
1092 EXPECT_EQ(2U, sink_->message_count()); | 1093 EXPECT_EQ(2U, sink_->message_count()); |
1093 | 1094 |
1094 if (sink_->message_count() == 2) { | 1095 if (sink_->message_count() == 2) { |
1095 // Verify mouse event happens after the confirm-composition event. | 1096 // Verify mouse event happens after the confirm-composition event. |
1096 EXPECT_EQ(InputMsg_ImeConfirmComposition::ID, | 1097 EXPECT_EQ(InputMsg_ImeConfirmComposition::ID, |
1097 sink_->GetMessageAt(0)->type()); | 1098 sink_->GetMessageAt(0)->type()); |
(...skipping 2503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3601 ViewMsg_SetSurfaceIdNamespace::Read(msg, ¶ms); | 3602 ViewMsg_SetSurfaceIdNamespace::Read(msg, ¶ms); |
3602 view_->InitAsChild(NULL); | 3603 view_->InitAsChild(NULL); |
3603 view_->Show(); | 3604 view_->Show(); |
3604 view_->SetSize(size); | 3605 view_->SetSize(size); |
3605 view_->OnSwapCompositorFrame(0, | 3606 view_->OnSwapCompositorFrame(0, |
3606 MakeDelegatedFrame(1.f, size, gfx::Rect(size))); | 3607 MakeDelegatedFrame(1.f, size, gfx::Rect(size))); |
3607 EXPECT_EQ(view_->GetSurfaceIdNamespace(), base::get<0>(params)); | 3608 EXPECT_EQ(view_->GetSurfaceIdNamespace(), base::get<0>(params)); |
3608 } | 3609 } |
3609 | 3610 |
3610 } // namespace content | 3611 } // namespace content |
OLD | NEW |