Commit bf9f2827 authored by Antonio Gomes's avatar Antonio Gomes Committed by Commit Bot

[ozone/wayland] various driven-by style fixes.

Code in //ui/ozone/platform/wayland/fake_server.cc|h is quite
convoluted today. This a 3/n of a series of patches that clean it up.

Particularly, CL changes the wayland unittest's code to use the "bleh_"
terminology rather than "bleh" for class member declaration, as per
Chromium's coding style.

BUG=None
TBR=rjkroege@chromium.org

Change-Id: I3534937d2ed842b0723e622f39668d4ac6c557c0
Reviewed-on: https://chromium-review.googlesource.com/961143
Commit-Queue: Antonio Gomes <tonikitoo@igalia.com>
Reviewed-by: default avatarAntonio Gomes <tonikitoo@igalia.com>
Cr-Commit-Position: refs/heads/master@{#543072}
parent 4d51ebfa
...@@ -139,7 +139,7 @@ void GetPointer(wl_client* client, wl_resource* resource, uint32_t id) { ...@@ -139,7 +139,7 @@ void GetPointer(wl_client* client, wl_resource* resource, uint32_t id) {
return; return;
} }
auto* seat = GetUserDataAs<MockSeat>(resource); auto* seat = GetUserDataAs<MockSeat>(resource);
seat->pointer.reset(new MockPointer(pointer_resource)); seat->pointer_.reset(new MockPointer(pointer_resource));
} }
void GetKeyboard(wl_client* client, wl_resource* resource, uint32_t id) { void GetKeyboard(wl_client* client, wl_resource* resource, uint32_t id) {
...@@ -150,7 +150,7 @@ void GetKeyboard(wl_client* client, wl_resource* resource, uint32_t id) { ...@@ -150,7 +150,7 @@ void GetKeyboard(wl_client* client, wl_resource* resource, uint32_t id) {
return; return;
} }
auto* seat = GetUserDataAs<MockSeat>(resource); auto* seat = GetUserDataAs<MockSeat>(resource);
seat->keyboard.reset(new MockKeyboard(keyboard_resource)); seat->keyboard_.reset(new MockKeyboard(keyboard_resource));
} }
void GetTouch(wl_client* client, wl_resource* resource, uint32_t id) { void GetTouch(wl_client* client, wl_resource* resource, uint32_t id) {
...@@ -161,7 +161,7 @@ void GetTouch(wl_client* client, wl_resource* resource, uint32_t id) { ...@@ -161,7 +161,7 @@ void GetTouch(wl_client* client, wl_resource* resource, uint32_t id) {
return; return;
} }
auto* seat = GetUserDataAs<MockSeat>(resource); auto* seat = GetUserDataAs<MockSeat>(resource);
seat->touch.reset(new MockTouch(touch_resource)); seat->touch_.reset(new MockTouch(touch_resource));
} }
const struct wl_seat_interface seat_impl = { const struct wl_seat_interface seat_impl = {
......
...@@ -207,9 +207,9 @@ class MockSeat : public Global { ...@@ -207,9 +207,9 @@ class MockSeat : public Global {
MockSeat(); MockSeat();
~MockSeat() override; ~MockSeat() override;
std::unique_ptr<MockPointer> pointer; std::unique_ptr<MockPointer> pointer_;
std::unique_ptr<MockKeyboard> keyboard; std::unique_ptr<MockKeyboard> keyboard_;
std::unique_ptr<MockTouch> touch; std::unique_ptr<MockTouch> touch_;
private: private:
DISALLOW_COPY_AND_ASSIGN(MockSeat); DISALLOW_COPY_AND_ASSIGN(MockSeat);
......
...@@ -25,17 +25,17 @@ class WaylandPointerTest : public WaylandTest { ...@@ -25,17 +25,17 @@ class WaylandPointerTest : public WaylandTest {
void SetUp() override { void SetUp() override {
WaylandTest::SetUp(); WaylandTest::SetUp();
wl_seat_send_capabilities(server.seat()->resource(), wl_seat_send_capabilities(server_.seat()->resource(),
WL_SEAT_CAPABILITY_POINTER); WL_SEAT_CAPABILITY_POINTER);
Sync(); Sync();
pointer = server.seat()->pointer.get(); pointer_ = server_.seat()->pointer_.get();
ASSERT_TRUE(pointer); ASSERT_TRUE(pointer_);
} }
protected: protected:
wl::MockPointer* pointer; wl::MockPointer* pointer_;
private: private:
DISALLOW_COPY_AND_ASSIGN(WaylandPointerTest); DISALLOW_COPY_AND_ASSIGN(WaylandPointerTest);
...@@ -43,7 +43,7 @@ class WaylandPointerTest : public WaylandTest { ...@@ -43,7 +43,7 @@ class WaylandPointerTest : public WaylandTest {
TEST_P(WaylandPointerTest, Leave) { TEST_P(WaylandPointerTest, Leave) {
MockPlatformWindowDelegate other_delegate; MockPlatformWindowDelegate other_delegate;
WaylandWindow other_window(&other_delegate, connection.get(), WaylandWindow other_window(&other_delegate, connection_.get(),
gfx::Rect(0, 0, 10, 10)); gfx::Rect(0, 0, 10, 10));
gfx::AcceleratedWidget other_widget = gfx::kNullAcceleratedWidget; gfx::AcceleratedWidget other_widget = gfx::kNullAcceleratedWidget;
EXPECT_CALL(other_delegate, OnAcceleratedWidgetAvailable(_, _)) EXPECT_CALL(other_delegate, OnAcceleratedWidgetAvailable(_, _))
...@@ -54,16 +54,16 @@ TEST_P(WaylandPointerTest, Leave) { ...@@ -54,16 +54,16 @@ TEST_P(WaylandPointerTest, Leave) {
Sync(); Sync();
wl::MockSurface* other_surface = wl::MockSurface* other_surface =
server.GetObject<wl::MockSurface>(other_widget); server_.GetObject<wl::MockSurface>(other_widget);
ASSERT_TRUE(other_surface); ASSERT_TRUE(other_surface);
wl_pointer_send_enter(pointer->resource(), 1, surface->resource(), 0, 0); wl_pointer_send_enter(pointer_->resource(), 1, surface_->resource(), 0, 0);
wl_pointer_send_leave(pointer->resource(), 2, surface->resource()); wl_pointer_send_leave(pointer_->resource(), 2, surface_->resource());
wl_pointer_send_enter(pointer->resource(), 3, other_surface->resource(), 0, wl_pointer_send_enter(pointer_->resource(), 3, other_surface->resource(), 0,
0); 0);
wl_pointer_send_button(pointer->resource(), 4, 1004, BTN_LEFT, wl_pointer_send_button(pointer_->resource(), 4, 1004, BTN_LEFT,
WL_POINTER_BUTTON_STATE_PRESSED); WL_POINTER_BUTTON_STATE_PRESSED);
EXPECT_CALL(delegate, DispatchEvent(_)).Times(1); EXPECT_CALL(delegate_, DispatchEvent(_)).Times(1);
// Do an extra Sync() here so that we process the second enter event before we // Do an extra Sync() here so that we process the second enter event before we
// destroy |other_window|. // destroy |other_window|.
...@@ -75,12 +75,13 @@ ACTION_P(CloneEvent, ptr) { ...@@ -75,12 +75,13 @@ ACTION_P(CloneEvent, ptr) {
} }
TEST_P(WaylandPointerTest, Motion) { TEST_P(WaylandPointerTest, Motion) {
wl_pointer_send_enter(pointer->resource(), 1, surface->resource(), 0, 0); wl_pointer_send_enter(pointer_->resource(), 1, surface_->resource(), 0, 0);
wl_pointer_send_motion(pointer->resource(), 1002, wl_fixed_from_double(10.75), wl_pointer_send_motion(pointer_->resource(), 1002,
wl_fixed_from_double(10.75),
wl_fixed_from_double(20.375)); wl_fixed_from_double(20.375));
std::unique_ptr<Event> event; std::unique_ptr<Event> event;
EXPECT_CALL(delegate, DispatchEvent(_)).WillOnce(CloneEvent(&event)); EXPECT_CALL(delegate_, DispatchEvent(_)).WillOnce(CloneEvent(&event));
Sync(); Sync();
...@@ -95,15 +96,15 @@ TEST_P(WaylandPointerTest, Motion) { ...@@ -95,15 +96,15 @@ TEST_P(WaylandPointerTest, Motion) {
} }
TEST_P(WaylandPointerTest, MotionDragged) { TEST_P(WaylandPointerTest, MotionDragged) {
wl_pointer_send_enter(pointer->resource(), 1, surface->resource(), 0, 0); wl_pointer_send_enter(pointer_->resource(), 1, surface_->resource(), 0, 0);
wl_pointer_send_button(pointer->resource(), 2, 1002, BTN_MIDDLE, wl_pointer_send_button(pointer_->resource(), 2, 1002, BTN_MIDDLE,
WL_POINTER_BUTTON_STATE_PRESSED); WL_POINTER_BUTTON_STATE_PRESSED);
Sync(); Sync();
std::unique_ptr<Event> event; std::unique_ptr<Event> event;
EXPECT_CALL(delegate, DispatchEvent(_)).WillOnce(CloneEvent(&event)); EXPECT_CALL(delegate_, DispatchEvent(_)).WillOnce(CloneEvent(&event));
wl_pointer_send_motion(pointer->resource(), 1003, wl_fixed_from_int(400), wl_pointer_send_motion(pointer_->resource(), 1003, wl_fixed_from_int(400),
wl_fixed_from_int(500)); wl_fixed_from_int(500));
Sync(); Sync();
...@@ -119,16 +120,16 @@ TEST_P(WaylandPointerTest, MotionDragged) { ...@@ -119,16 +120,16 @@ TEST_P(WaylandPointerTest, MotionDragged) {
} }
TEST_P(WaylandPointerTest, ButtonPress) { TEST_P(WaylandPointerTest, ButtonPress) {
wl_pointer_send_enter(pointer->resource(), 1, surface->resource(), wl_pointer_send_enter(pointer_->resource(), 1, surface_->resource(),
wl_fixed_from_int(200), wl_fixed_from_int(150)); wl_fixed_from_int(200), wl_fixed_from_int(150));
wl_pointer_send_button(pointer->resource(), 2, 1002, BTN_RIGHT, wl_pointer_send_button(pointer_->resource(), 2, 1002, BTN_RIGHT,
WL_POINTER_BUTTON_STATE_PRESSED); WL_POINTER_BUTTON_STATE_PRESSED);
Sync(); Sync();
std::unique_ptr<Event> event; std::unique_ptr<Event> event;
EXPECT_CALL(delegate, DispatchEvent(_)).WillOnce(CloneEvent(&event)); EXPECT_CALL(delegate_, DispatchEvent(_)).WillOnce(CloneEvent(&event));
wl_pointer_send_button(pointer->resource(), 3, 1003, BTN_LEFT, wl_pointer_send_button(pointer_->resource(), 3, 1003, BTN_LEFT,
WL_POINTER_BUTTON_STATE_PRESSED); WL_POINTER_BUTTON_STATE_PRESSED);
Sync(); Sync();
...@@ -145,18 +146,18 @@ TEST_P(WaylandPointerTest, ButtonPress) { ...@@ -145,18 +146,18 @@ TEST_P(WaylandPointerTest, ButtonPress) {
} }
TEST_P(WaylandPointerTest, ButtonRelease) { TEST_P(WaylandPointerTest, ButtonRelease) {
wl_pointer_send_enter(pointer->resource(), 1, surface->resource(), wl_pointer_send_enter(pointer_->resource(), 1, surface_->resource(),
wl_fixed_from_int(50), wl_fixed_from_int(50)); wl_fixed_from_int(50), wl_fixed_from_int(50));
wl_pointer_send_button(pointer->resource(), 2, 1002, BTN_BACK, wl_pointer_send_button(pointer_->resource(), 2, 1002, BTN_BACK,
WL_POINTER_BUTTON_STATE_PRESSED); WL_POINTER_BUTTON_STATE_PRESSED);
wl_pointer_send_button(pointer->resource(), 3, 1003, BTN_LEFT, wl_pointer_send_button(pointer_->resource(), 3, 1003, BTN_LEFT,
WL_POINTER_BUTTON_STATE_PRESSED); WL_POINTER_BUTTON_STATE_PRESSED);
Sync(); Sync();
std::unique_ptr<Event> event; std::unique_ptr<Event> event;
EXPECT_CALL(delegate, DispatchEvent(_)).WillOnce(CloneEvent(&event)); EXPECT_CALL(delegate_, DispatchEvent(_)).WillOnce(CloneEvent(&event));
wl_pointer_send_button(pointer->resource(), 4, 1004, BTN_LEFT, wl_pointer_send_button(pointer_->resource(), 4, 1004, BTN_LEFT,
WL_POINTER_BUTTON_STATE_RELEASED); WL_POINTER_BUTTON_STATE_RELEASED);
Sync(); Sync();
...@@ -173,17 +174,17 @@ TEST_P(WaylandPointerTest, ButtonRelease) { ...@@ -173,17 +174,17 @@ TEST_P(WaylandPointerTest, ButtonRelease) {
} }
TEST_P(WaylandPointerTest, AxisVertical) { TEST_P(WaylandPointerTest, AxisVertical) {
wl_pointer_send_enter(pointer->resource(), 1, surface->resource(), wl_pointer_send_enter(pointer_->resource(), 1, surface_->resource(),
wl_fixed_from_int(0), wl_fixed_from_int(0)); wl_fixed_from_int(0), wl_fixed_from_int(0));
wl_pointer_send_button(pointer->resource(), 2, 1002, BTN_RIGHT, wl_pointer_send_button(pointer_->resource(), 2, 1002, BTN_RIGHT,
WL_POINTER_BUTTON_STATE_PRESSED); WL_POINTER_BUTTON_STATE_PRESSED);
Sync(); Sync();
std::unique_ptr<Event> event; std::unique_ptr<Event> event;
EXPECT_CALL(delegate, DispatchEvent(_)).WillOnce(CloneEvent(&event)); EXPECT_CALL(delegate_, DispatchEvent(_)).WillOnce(CloneEvent(&event));
// Wayland servers typically send a value of 10 per mouse wheel click. // Wayland servers typically send a value of 10 per mouse wheel click.
wl_pointer_send_axis(pointer->resource(), 1003, wl_pointer_send_axis(pointer_->resource(), 1003,
WL_POINTER_AXIS_VERTICAL_SCROLL, wl_fixed_from_int(20)); WL_POINTER_AXIS_VERTICAL_SCROLL, wl_fixed_from_int(20));
Sync(); Sync();
...@@ -200,17 +201,17 @@ TEST_P(WaylandPointerTest, AxisVertical) { ...@@ -200,17 +201,17 @@ TEST_P(WaylandPointerTest, AxisVertical) {
} }
TEST_P(WaylandPointerTest, AxisHorizontal) { TEST_P(WaylandPointerTest, AxisHorizontal) {
wl_pointer_send_enter(pointer->resource(), 1, surface->resource(), wl_pointer_send_enter(pointer_->resource(), 1, surface_->resource(),
wl_fixed_from_int(50), wl_fixed_from_int(75)); wl_fixed_from_int(50), wl_fixed_from_int(75));
wl_pointer_send_button(pointer->resource(), 2, 1002, BTN_LEFT, wl_pointer_send_button(pointer_->resource(), 2, 1002, BTN_LEFT,
WL_POINTER_BUTTON_STATE_PRESSED); WL_POINTER_BUTTON_STATE_PRESSED);
Sync(); Sync();
std::unique_ptr<Event> event; std::unique_ptr<Event> event;
EXPECT_CALL(delegate, DispatchEvent(_)).WillOnce(CloneEvent(&event)); EXPECT_CALL(delegate_, DispatchEvent(_)).WillOnce(CloneEvent(&event));
// Wayland servers typically send a value of 10 per mouse wheel click. // Wayland servers typically send a value of 10 per mouse wheel click.
wl_pointer_send_axis(pointer->resource(), 1003, wl_pointer_send_axis(pointer_->resource(), 1003,
WL_POINTER_AXIS_HORIZONTAL_SCROLL, WL_POINTER_AXIS_HORIZONTAL_SCROLL,
wl_fixed_from_int(10)); wl_fixed_from_int(10));
......
...@@ -19,13 +19,13 @@ namespace ui { ...@@ -19,13 +19,13 @@ namespace ui {
class WaylandSurfaceFactoryTest : public WaylandTest { class WaylandSurfaceFactoryTest : public WaylandTest {
public: public:
WaylandSurfaceFactoryTest() : surface_factory(connection.get()) {} WaylandSurfaceFactoryTest() : surface_factory(connection_.get()) {}
~WaylandSurfaceFactoryTest() override {} ~WaylandSurfaceFactoryTest() override {}
void SetUp() override { void SetUp() override {
WaylandTest::SetUp(); WaylandTest::SetUp();
canvas = surface_factory.CreateCanvasForWidget(widget); canvas = surface_factory.CreateCanvasForWidget(widget_);
ASSERT_TRUE(canvas); ASSERT_TRUE(canvas);
} }
...@@ -41,11 +41,11 @@ TEST_P(WaylandSurfaceFactoryTest, Canvas) { ...@@ -41,11 +41,11 @@ TEST_P(WaylandSurfaceFactoryTest, Canvas) {
canvas->GetSurface(); canvas->GetSurface();
canvas->PresentCanvas(gfx::Rect(5, 10, 20, 15)); canvas->PresentCanvas(gfx::Rect(5, 10, 20, 15));
Expectation damage = EXPECT_CALL(*surface, Damage(5, 10, 20, 15)); Expectation damage = EXPECT_CALL(*surface_, Damage(5, 10, 20, 15));
wl_resource* buffer_resource = nullptr; wl_resource* buffer_resource = nullptr;
Expectation attach = EXPECT_CALL(*surface, Attach(_, 0, 0)) Expectation attach = EXPECT_CALL(*surface_, Attach(_, 0, 0))
.WillOnce(SaveArg<0>(&buffer_resource)); .WillOnce(SaveArg<0>(&buffer_resource));
EXPECT_CALL(*surface, Commit()).After(damage, attach); EXPECT_CALL(*surface_, Commit()).After(damage, attach);
Sync(); Sync();
...@@ -65,11 +65,11 @@ TEST_P(WaylandSurfaceFactoryTest, CanvasResize) { ...@@ -65,11 +65,11 @@ TEST_P(WaylandSurfaceFactoryTest, CanvasResize) {
canvas->GetSurface(); canvas->GetSurface();
canvas->PresentCanvas(gfx::Rect(0, 0, 100, 50)); canvas->PresentCanvas(gfx::Rect(0, 0, 100, 50));
Expectation damage = EXPECT_CALL(*surface, Damage(0, 0, 100, 50)); Expectation damage = EXPECT_CALL(*surface_, Damage(0, 0, 100, 50));
wl_resource* buffer_resource = nullptr; wl_resource* buffer_resource = nullptr;
Expectation attach = EXPECT_CALL(*surface, Attach(_, 0, 0)) Expectation attach = EXPECT_CALL(*surface_, Attach(_, 0, 0))
.WillOnce(SaveArg<0>(&buffer_resource)); .WillOnce(SaveArg<0>(&buffer_resource));
EXPECT_CALL(*surface, Commit()).After(damage, attach); EXPECT_CALL(*surface_, Commit()).After(damage, attach);
Sync(); Sync();
......
...@@ -27,48 +27,48 @@ WaylandTest::WaylandTest() { ...@@ -27,48 +27,48 @@ WaylandTest::WaylandTest() {
KeyboardLayoutEngineManager::SetKeyboardLayoutEngine( KeyboardLayoutEngineManager::SetKeyboardLayoutEngine(
std::make_unique<StubKeyboardLayoutEngine>()); std::make_unique<StubKeyboardLayoutEngine>());
#endif #endif
connection.reset(new WaylandConnection); connection_.reset(new WaylandConnection);
window = std::make_unique<WaylandWindow>(&delegate, connection.get(), window_ = std::make_unique<WaylandWindow>(&delegate_, connection_.get(),
gfx::Rect(0, 0, 800, 600)); gfx::Rect(0, 0, 800, 600));
} }
WaylandTest::~WaylandTest() {} WaylandTest::~WaylandTest() {}
void WaylandTest::SetUp() { void WaylandTest::SetUp() {
ASSERT_TRUE(server.Start(GetParam())); ASSERT_TRUE(server_.Start(GetParam()));
ASSERT_TRUE(connection->Initialize()); ASSERT_TRUE(connection_->Initialize());
EXPECT_CALL(delegate, OnAcceleratedWidgetAvailable(_, _)) EXPECT_CALL(delegate_, OnAcceleratedWidgetAvailable(_, _))
.WillOnce(SaveArg<0>(&widget)); .WillOnce(SaveArg<0>(&widget_));
ASSERT_TRUE(window->Initialize()); ASSERT_TRUE(window_->Initialize());
ASSERT_NE(widget, gfx::kNullAcceleratedWidget); ASSERT_NE(widget_, gfx::kNullAcceleratedWidget);
// Wait for the client to flush all pending requests from initialization. // Wait for the client to flush all pending requests from initialization.
base::RunLoop().RunUntilIdle(); base::RunLoop().RunUntilIdle();
// Pause the server after it has responded to all incoming events. // Pause the server after it has responded to all incoming events.
server.Pause(); server_.Pause();
surface = server.GetObject<wl::MockSurface>(widget); surface_ = server_.GetObject<wl::MockSurface>(widget_);
ASSERT_TRUE(surface); ASSERT_TRUE(surface_);
initialized = true; initialized_ = true;
} }
void WaylandTest::TearDown() { void WaylandTest::TearDown() {
if (initialized) if (initialized_)
Sync(); Sync();
} }
void WaylandTest::Sync() { void WaylandTest::Sync() {
// Resume the server, flushing its pending events. // Resume the server, flushing its pending events.
server.Resume(); server_.Resume();
// Wait for the client to finish processing these events. // Wait for the client to finish processing these events.
base::RunLoop().RunUntilIdle(); base::RunLoop().RunUntilIdle();
// Pause the server, after it has finished processing any follow-up requests // Pause the server, after it has finished processing any follow-up requests
// from the client. // from the client.
server.Pause(); server_.Pause();
} }
} // namespace ui } // namespace ui
...@@ -35,17 +35,17 @@ class WaylandTest : public ::testing::TestWithParam<uint32_t> { ...@@ -35,17 +35,17 @@ class WaylandTest : public ::testing::TestWithParam<uint32_t> {
void Sync(); void Sync();
private: private:
bool initialized = false; base::MessageLoopForUI message_loop_;
base::MessageLoopForUI message_loop; bool initialized_ = false;
protected: protected:
wl::FakeServer server; wl::FakeServer server_;
wl::MockSurface* surface; wl::MockSurface* surface_;
MockPlatformWindowDelegate delegate; MockPlatformWindowDelegate delegate_;
std::unique_ptr<WaylandConnection> connection; std::unique_ptr<WaylandConnection> connection_;
std::unique_ptr<WaylandWindow> window; std::unique_ptr<WaylandWindow> window_;
gfx::AcceleratedWidget widget = gfx::kNullAcceleratedWidget; gfx::AcceleratedWidget widget_ = gfx::kNullAcceleratedWidget;
private: private:
#if BUILDFLAG(USE_XKBCOMMON) #if BUILDFLAG(USE_XKBCOMMON)
......
...@@ -33,13 +33,13 @@ class WaylandTouchTest : public WaylandTest { ...@@ -33,13 +33,13 @@ class WaylandTouchTest : public WaylandTest {
void SetUp() override { void SetUp() override {
WaylandTest::SetUp(); WaylandTest::SetUp();
wl_seat_send_capabilities(server.seat()->resource(), wl_seat_send_capabilities(server_.seat()->resource(),
WL_SEAT_CAPABILITY_TOUCH); WL_SEAT_CAPABILITY_TOUCH);
Sync(); Sync();
touch = server.seat()->touch.get(); touch_ = server_.seat()->touch_.get();
ASSERT_TRUE(touch); ASSERT_TRUE(touch_);
} }
protected: protected:
...@@ -51,7 +51,7 @@ class WaylandTouchTest : public WaylandTest { ...@@ -51,7 +51,7 @@ class WaylandTouchTest : public WaylandTest {
EXPECT_EQ(event_type, key_event->type()); EXPECT_EQ(event_type, key_event->type());
} }
wl::MockTouch* touch; wl::MockTouch* touch_;
private: private:
DISALLOW_COPY_AND_ASSIGN(WaylandTouchTest); DISALLOW_COPY_AND_ASSIGN(WaylandTouchTest);
...@@ -59,21 +59,21 @@ class WaylandTouchTest : public WaylandTest { ...@@ -59,21 +59,21 @@ class WaylandTouchTest : public WaylandTest {
TEST_P(WaylandTouchTest, KeypressAndMotion) { TEST_P(WaylandTouchTest, KeypressAndMotion) {
std::unique_ptr<Event> event; std::unique_ptr<Event> event;
EXPECT_CALL(delegate, DispatchEvent(_)).WillRepeatedly(CloneEvent(&event)); EXPECT_CALL(delegate_, DispatchEvent(_)).WillRepeatedly(CloneEvent(&event));
wl_touch_send_down(touch->resource(), 1, 0, surface->resource(), 0 /* id */, wl_touch_send_down(touch_->resource(), 1, 0, surface_->resource(), 0 /* id */,
wl_fixed_from_int(50), wl_fixed_from_int(100)); wl_fixed_from_int(50), wl_fixed_from_int(100));
Sync(); Sync();
CheckEventType(ui::ET_TOUCH_PRESSED, event.get()); CheckEventType(ui::ET_TOUCH_PRESSED, event.get());
wl_touch_send_motion(touch->resource(), 500, 0 /* id */, wl_touch_send_motion(touch_->resource(), 500, 0 /* id */,
wl_fixed_from_int(100), wl_fixed_from_int(100)); wl_fixed_from_int(100), wl_fixed_from_int(100));
Sync(); Sync();
CheckEventType(ui::ET_TOUCH_MOVED, event.get()); CheckEventType(ui::ET_TOUCH_MOVED, event.get());
wl_touch_send_up(touch->resource(), 1, 1000, 0 /* id */); wl_touch_send_up(touch_->resource(), 1, 1000, 0 /* id */);
Sync(); Sync();
CheckEventType(ui::ET_TOUCH_RELEASED, event.get()); CheckEventType(ui::ET_TOUCH_RELEASED, event.get());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment