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

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

Issue 667943003: Standardize usage of virtual/override/final in content/browser/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 <vector> 5 #include <vector>
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/time/time.h" 10 #include "base/time/time.h"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 virtual void TearDown() override { 60 virtual void TearDown() override {
61 emulator_->Disable(); 61 emulator_->Disable();
62 EXPECT_EQ("", ExpectedEvents()); 62 EXPECT_EQ("", ExpectedEvents());
63 63
64 #if defined(USE_AURA) 64 #if defined(USE_AURA)
65 aura::Env::DeleteInstance(); 65 aura::Env::DeleteInstance();
66 screen_.reset(); 66 screen_.reset();
67 #endif 67 #endif
68 } 68 }
69 69
70 virtual void ForwardGestureEvent( 70 void ForwardGestureEvent(const blink::WebGestureEvent& event) override {
71 const blink::WebGestureEvent& event) override {
72 forwarded_events_.push_back(event.type); 71 forwarded_events_.push_back(event.type);
73 } 72 }
74 73
75 virtual void ForwardEmulatedTouchEvent( 74 void ForwardEmulatedTouchEvent(const blink::WebTouchEvent& event) override {
76 const blink::WebTouchEvent& event) override {
77 forwarded_events_.push_back(event.type); 75 forwarded_events_.push_back(event.type);
78 EXPECT_EQ(1U, event.touchesLength); 76 EXPECT_EQ(1U, event.touchesLength);
79 EXPECT_EQ(last_mouse_x_, event.touches[0].position.x); 77 EXPECT_EQ(last_mouse_x_, event.touches[0].position.x);
80 EXPECT_EQ(last_mouse_y_, event.touches[0].position.y); 78 EXPECT_EQ(last_mouse_y_, event.touches[0].position.y);
81 int expectedCancelable = event.type != WebInputEvent::TouchCancel; 79 int expectedCancelable = event.type != WebInputEvent::TouchCancel;
82 EXPECT_EQ(expectedCancelable, event.cancelable); 80 EXPECT_EQ(expectedCancelable, event.cancelable);
83 if (ack_touches_synchronously_) { 81 if (ack_touches_synchronously_) {
84 emulator()->HandleTouchEventAck( 82 emulator()->HandleTouchEventAck(
85 event, INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS); 83 event, INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS);
86 } 84 }
87 } 85 }
88 86
89 virtual void SetCursor(const WebCursor& cursor) override {} 87 void SetCursor(const WebCursor& cursor) override {}
90 88
91 virtual void ShowContextMenuAtPoint(const gfx::Point& point) override {} 89 void ShowContextMenuAtPoint(const gfx::Point& point) override {}
92 90
93 protected: 91 protected:
94 TouchEmulator* emulator() const { 92 TouchEmulator* emulator() const {
95 return emulator_.get(); 93 return emulator_.get();
96 } 94 }
97 95
98 int modifiers() const { 96 int modifiers() const {
99 return shift_pressed_ ? WebInputEvent::ShiftKey : 0; 97 return shift_pressed_ ? WebInputEvent::ShiftKey : 0;
100 } 98 }
101 99
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after
516 MouseDown(100, 200); 514 MouseDown(100, 200);
517 EXPECT_EQ("TouchStart GestureTapDown", ExpectedEvents()); 515 EXPECT_EQ("TouchStart GestureTapDown", ExpectedEvents());
518 MouseUp(200, 200); 516 MouseUp(200, 200);
519 EXPECT_EQ( 517 EXPECT_EQ(
520 "TouchMove GestureTapCancel GestureScrollBegin GestureScrollUpdate" 518 "TouchMove GestureTapCancel GestureScrollBegin GestureScrollUpdate"
521 " TouchEnd GestureScrollEnd", 519 " TouchEnd GestureScrollEnd",
522 ExpectedEvents()); 520 ExpectedEvents());
523 } 521 }
524 522
525 } // namespace content 523 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698