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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_mac_unittest.mm

Issue 2250233002: Type->String helper function added to WebInputEvent. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Blink_Common_export instead of blink_export Created 4 years, 3 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
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_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
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, &params)); 114 EXPECT_TRUE(InputMsg_HandleInputEvent::Read(message, &params));
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698