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

Side by Side Diff: content/browser/renderer_host/input/touch_emulator_unittest.cc

Issue 2240983003: Move |ScopedWebInputEvent| and |WebInputEventTraits| from |content::| to "ui/events/blink" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and ncarter's review Created 4 years, 4 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/input/touch_emulator.h" 5 #include "content/browser/renderer_host/input/touch_emulator.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/message_loop/message_loop.h" 12 #include "base/message_loop/message_loop.h"
13 #include "base/time/time.h" 13 #include "base/time/time.h"
14 #include "content/browser/renderer_host/input/touch_emulator_client.h" 14 #include "content/browser/renderer_host/input/touch_emulator_client.h"
15 #include "content/common/input/web_input_event_traits.h"
16 #include "testing/gtest/include/gtest/gtest.h" 15 #include "testing/gtest/include/gtest/gtest.h"
16 #include "ui/events/blink/web_input_event_traits.h"
17 17
18 using blink::WebGestureEvent; 18 using blink::WebGestureEvent;
19 using blink::WebInputEvent; 19 using blink::WebInputEvent;
20 using blink::WebKeyboardEvent; 20 using blink::WebKeyboardEvent;
21 using blink::WebMouseEvent; 21 using blink::WebMouseEvent;
22 using blink::WebMouseWheelEvent; 22 using blink::WebMouseWheelEvent;
23 using blink::WebTouchEvent; 23 using blink::WebTouchEvent;
24 using blink::WebTouchPoint; 24 using blink::WebTouchPoint;
25 25
26 namespace content { 26 namespace content {
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 int modifiers() const { 89 int modifiers() const {
90 return (shift_pressed_ ? WebInputEvent::ShiftKey : 0) | 90 return (shift_pressed_ ? WebInputEvent::ShiftKey : 0) |
91 (mouse_pressed_ ? WebInputEvent::LeftButtonDown : 0); 91 (mouse_pressed_ ? WebInputEvent::LeftButtonDown : 0);
92 } 92 }
93 93
94 std::string ExpectedEvents() { 94 std::string ExpectedEvents() {
95 std::string result; 95 std::string result;
96 for (size_t i = 0; i < forwarded_events_.size(); ++i) { 96 for (size_t i = 0; i < forwarded_events_.size(); ++i) {
97 if (i != 0) 97 if (i != 0)
98 result += " "; 98 result += " ";
99 result += WebInputEventTraits::GetName(forwarded_events_[i]); 99 result += ui::WebInputEventTraits::GetName(forwarded_events_[i]);
100 } 100 }
101 forwarded_events_.clear(); 101 forwarded_events_.clear();
102 return result; 102 return result;
103 } 103 }
104 104
105 double GetNextEventTimeSeconds() { 105 double GetNextEventTimeSeconds() {
106 last_event_time_seconds_ += event_time_delta_seconds_; 106 last_event_time_seconds_ += event_time_delta_seconds_;
107 return last_event_time_seconds_; 107 return last_event_time_seconds_;
108 } 108 }
109 109
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after
563 emulator()->Disable(); 563 emulator()->Disable();
564 EXPECT_EQ("TouchStart TouchCancel", ExpectedEvents()); 564 EXPECT_EQ("TouchStart TouchCancel", ExpectedEvents());
565 emulator()->CancelTouch(); 565 emulator()->CancelTouch();
566 } 566 }
567 567
568 TEST_F(TouchEmulatorTest, ConstructorWithHighDeviceScaleDoesNotCrash) { 568 TEST_F(TouchEmulatorTest, ConstructorWithHighDeviceScaleDoesNotCrash) {
569 TouchEmulator(this, 4.0f); 569 TouchEmulator(this, 4.0f);
570 } 570 }
571 571
572 } // namespace content 572 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698