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

Unified Diff: components/exo/gamepad_unittest.cc

Issue 2396883003: exo: Fix dragging edge cases (Closed)
Patch Set: Fix unit tests Created 4 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 side-by-side diff with in-line comments
Download patch
Index: components/exo/gamepad_unittest.cc
diff --git a/components/exo/gamepad_unittest.cc b/components/exo/gamepad_unittest.cc
index 34a7e165bd818587e15d054ae9ff1a129252887f..604bd8218678520947e16866d491a7dd132c28fc 100644
--- a/components/exo/gamepad_unittest.cc
+++ b/components/exo/gamepad_unittest.cc
@@ -7,6 +7,7 @@
#include "base/run_loop.h"
#include "base/test/test_simple_task_runner.h"
#include "components/exo/buffer.h"
+#include "components/exo/display.h"
#include "components/exo/gamepad.h"
#include "components/exo/gamepad_delegate.h"
#include "components/exo/shell_surface.h"
@@ -88,8 +89,10 @@ class GamepadTest : public test::ExoTestBase {
};
TEST_F(GamepadTest, OnStateChange) {
+ const Display display;
std::unique_ptr<Surface> surface(new Surface);
- std::unique_ptr<ShellSurface> shell_surface(new ShellSurface(surface.get()));
+ std::unique_ptr<ShellSurface> shell_surface(
+ new ShellSurface(display, surface.get()));
gfx::Size buffer_size(10, 10);
std::unique_ptr<Buffer> buffer(
new Buffer(exo_test_helper()->CreateGpuMemoryBuffer(buffer_size)));
@@ -119,8 +122,10 @@ TEST_F(GamepadTest, OnStateChange) {
}
TEST_F(GamepadTest, OnAxis) {
+ const Display display;
std::unique_ptr<Surface> surface(new Surface);
- std::unique_ptr<ShellSurface> shell_surface(new ShellSurface(surface.get()));
+ std::unique_ptr<ShellSurface> shell_surface(
+ new ShellSurface(display, surface.get()));
gfx::Size buffer_size(10, 10);
std::unique_ptr<Buffer> buffer(
new Buffer(exo_test_helper()->CreateGpuMemoryBuffer(buffer_size)));
@@ -149,8 +154,10 @@ TEST_F(GamepadTest, OnAxis) {
}
TEST_F(GamepadTest, OnButton) {
+ const Display display;
std::unique_ptr<Surface> surface(new Surface);
- std::unique_ptr<ShellSurface> shell_surface(new ShellSurface(surface.get()));
+ std::unique_ptr<ShellSurface> shell_surface(
+ new ShellSurface(display, surface.get()));
gfx::Size buffer_size(10, 10);
std::unique_ptr<Buffer> buffer(
new Buffer(exo_test_helper()->CreateGpuMemoryBuffer(buffer_size)));
@@ -181,8 +188,10 @@ TEST_F(GamepadTest, OnButton) {
TEST_F(GamepadTest, OnWindowFocused) {
// Create surface and move focus to it.
+ const Display display;
std::unique_ptr<Surface> surface(new Surface);
- std::unique_ptr<ShellSurface> shell_surface(new ShellSurface(surface.get()));
+ std::unique_ptr<ShellSurface> shell_surface(
+ new ShellSurface(display, surface.get()));
gfx::Size buffer_size(10, 10);
std::unique_ptr<Buffer> buffer(
new Buffer(exo_test_helper()->CreateGpuMemoryBuffer(buffer_size)));

Powered by Google App Engine
This is Rietveld 408576698