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

Side by Side Diff: ui/ozone/platform/wayland/wayland_window_unittest.cc

Issue 2786693002: Add PointerDetails to ui::MouseEvent's constructors (Closed)
Patch Set: mouse event constructor Created 3 years, 8 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 <wayland-server-core.h> 5 #include <wayland-server-core.h>
6 #include <xdg-shell-unstable-v5-server-protocol.h> 6 #include <xdg-shell-unstable-v5-server-protocol.h>
7 7
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "testing/gmock/include/gmock/gmock.h" 10 #include "testing/gmock/include/gmock/gmock.h"
11 #include "testing/gtest/include/gtest/gtest.h" 11 #include "testing/gtest/include/gtest/gtest.h"
12 #include "ui/events/base_event_utils.h" 12 #include "ui/events/base_event_utils.h"
13 #include "ui/events/event.h" 13 #include "ui/events/event.h"
14 #include "ui/ozone/platform/wayland/fake_server.h" 14 #include "ui/ozone/platform/wayland/fake_server.h"
15 #include "ui/ozone/platform/wayland/mock_platform_window_delegate.h" 15 #include "ui/ozone/platform/wayland/mock_platform_window_delegate.h"
16 #include "ui/ozone/platform/wayland/wayland_test.h" 16 #include "ui/ozone/platform/wayland/wayland_test.h"
17 #include "ui/ozone/platform/wayland/wayland_window.h" 17 #include "ui/ozone/platform/wayland/wayland_window.h"
18 18
19 using ::testing::Eq; 19 using ::testing::Eq;
20 using ::testing::Mock; 20 using ::testing::Mock;
21 using ::testing::SaveArg; 21 using ::testing::SaveArg;
22 using ::testing::StrEq; 22 using ::testing::StrEq;
23 using ::testing::_; 23 using ::testing::_;
24 24
25 namespace ui { 25 namespace ui {
26 26
27 class WaylandWindowTest : public WaylandTest { 27 class WaylandWindowTest : public WaylandTest {
28 public: 28 public:
29 WaylandWindowTest() 29 WaylandWindowTest()
30 : test_mouse_event(ET_MOUSE_PRESSED, 30 : test_mouse_event(
31 gfx::Point(10, 15), 31 ET_MOUSE_PRESSED,
32 gfx::Point(10, 15), 32 gfx::Point(10, 15),
33 ui::EventTimeStampFromSeconds(123456), 33 gfx::Point(10, 15),
34 EF_LEFT_MOUSE_BUTTON | EF_RIGHT_MOUSE_BUTTON, 34 ui::EventTimeStampFromSeconds(123456),
35 EF_LEFT_MOUSE_BUTTON) {} 35 EF_LEFT_MOUSE_BUTTON | EF_RIGHT_MOUSE_BUTTON,
36 EF_LEFT_MOUSE_BUTTON,
37 ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_MOUSE)) {}
36 38
37 void SetUp() override { 39 void SetUp() override {
38 WaylandTest::SetUp(); 40 WaylandTest::SetUp();
39 41
40 xdg_surface = surface->xdg_surface.get(); 42 xdg_surface = surface->xdg_surface.get();
41 ASSERT_TRUE(xdg_surface); 43 ASSERT_TRUE(xdg_surface);
42 } 44 }
43 45
44 protected: 46 protected:
45 wl::MockXdgSurface* xdg_surface; 47 wl::MockXdgSurface* xdg_surface;
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 xdg_surface_send_configure(xdg_surface->resource(), 1000, 1000, &states, 12); 111 xdg_surface_send_configure(xdg_surface->resource(), 1000, 1000, &states, 12);
110 xdg_surface_send_configure(xdg_surface->resource(), 1500, 1000, &states, 13); 112 xdg_surface_send_configure(xdg_surface->resource(), 1500, 1000, &states, 13);
111 113
112 // Make sure that the implementation does not call OnBoundsChanged for each 114 // Make sure that the implementation does not call OnBoundsChanged for each
113 // configure event if it receives multiple in a row. 115 // configure event if it receives multiple in a row.
114 EXPECT_CALL(delegate, OnBoundsChanged(Eq(gfx::Rect(0, 0, 1500, 1000)))); 116 EXPECT_CALL(delegate, OnBoundsChanged(Eq(gfx::Rect(0, 0, 1500, 1000))));
115 EXPECT_CALL(*xdg_surface, AckConfigure(13)); 117 EXPECT_CALL(*xdg_surface, AckConfigure(13));
116 } 118 }
117 119
118 } // namespace ui 120 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698