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_mac.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_mac.h" |
6 | 6 |
7 #include <Cocoa/Cocoa.h> | 7 #include <Cocoa/Cocoa.h> |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 #include <tuple> | 10 #include <tuple> |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 std::string GetInputMessageTypes(MockRenderProcessHost* process) { | 108 std::string GetInputMessageTypes(MockRenderProcessHost* process) { |
109 std::string result; | 109 std::string result; |
110 for (size_t i = 0; i < process->sink().message_count(); ++i) { | 110 for (size_t i = 0; i < process->sink().message_count(); ++i) { |
111 const IPC::Message* message = process->sink().GetMessageAt(i); | 111 const IPC::Message* message = process->sink().GetMessageAt(i); |
112 EXPECT_EQ(InputMsg_HandleInputEvent::ID, message->type()); | 112 EXPECT_EQ(InputMsg_HandleInputEvent::ID, message->type()); |
113 InputMsg_HandleInputEvent::Param params; | 113 InputMsg_HandleInputEvent::Param params; |
114 EXPECT_TRUE(InputMsg_HandleInputEvent::Read(message, ¶ms)); | 114 EXPECT_TRUE(InputMsg_HandleInputEvent::Read(message, ¶ms)); |
115 const blink::WebInputEvent* event = std::get<0>(params); | 115 const blink::WebInputEvent* event = std::get<0>(params); |
116 if (i != 0) | 116 if (i != 0) |
117 result += " "; | 117 result += " "; |
118 result += ui::WebInputEventTraits::GetName(event->type); | 118 result += blink::WebInputEvent::GetName(event->type); |
119 } | 119 } |
120 process->sink().ClearMessages(); | 120 process->sink().ClearMessages(); |
121 return result; | 121 return result; |
122 } | 122 } |
123 | 123 |
124 id MockGestureEvent(NSEventType type, double magnification) { | 124 id MockGestureEvent(NSEventType type, double magnification) { |
125 id event = [OCMockObject mockForClass:[NSEvent class]]; | 125 id event = [OCMockObject mockForClass:[NSEvent class]]; |
126 NSPoint locationInWindow = NSMakePoint(0, 0); | 126 NSPoint locationInWindow = NSMakePoint(0, 0); |
127 CGFloat deltaX = 0; | 127 CGFloat deltaX = 0; |
128 CGFloat deltaY = 0; | 128 CGFloat deltaY = 0; |
(...skipping 1320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1449 // Repeat for the tab's view. | 1449 // Repeat for the tab's view. |
1450 [rwhv_cocoa_ setMarkedText:text | 1450 [rwhv_cocoa_ setMarkedText:text |
1451 selectedRange:selectedRange | 1451 selectedRange:selectedRange |
1452 replacementRange:replacementRange]; | 1452 replacementRange:replacementRange]; |
1453 EXPECT_TRUE([rwhv_cocoa_ hasMarkedText]); | 1453 EXPECT_TRUE([rwhv_cocoa_ hasMarkedText]); |
1454 rwhv_mac_->ImeCancelComposition(); | 1454 rwhv_mac_->ImeCancelComposition(); |
1455 EXPECT_FALSE([rwhv_cocoa_ hasMarkedText]); | 1455 EXPECT_FALSE([rwhv_cocoa_ hasMarkedText]); |
1456 } | 1456 } |
1457 | 1457 |
1458 } // namespace content | 1458 } // namespace content |
OLD | NEW |