| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef COMPONENTS_EXO_TEST_EXO_TEST_HELPER_H_ | 5 #ifndef COMPONENTS_EXO_TEST_EXO_TEST_HELPER_H_ |
| 6 #define COMPONENTS_EXO_TEST_EXO_TEST_HELPER_H_ | 6 #define COMPONENTS_EXO_TEST_EXO_TEST_HELPER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "ui/gfx/geometry/point.h" |
| 12 #include "ui/gfx/geometry/size.h" | 13 #include "ui/gfx/geometry/size.h" |
| 13 | 14 |
| 14 namespace gfx { | 15 namespace gfx { |
| 15 class GpuMemoryBuffer; | 16 class GpuMemoryBuffer; |
| 16 } | 17 } |
| 17 | 18 |
| 18 namespace exo { | 19 namespace exo { |
| 20 class Buffer; |
| 21 class Surface; |
| 22 class ShellSurface; |
| 23 |
| 19 namespace test { | 24 namespace test { |
| 20 | 25 |
| 26 class ExoTestWindow { |
| 27 public: |
| 28 ExoTestWindow(std::unique_ptr<gfx::GpuMemoryBuffer> gpu_buffer, |
| 29 bool is_modal); |
| 30 ExoTestWindow(ExoTestWindow&& window); |
| 31 virtual ~ExoTestWindow(); |
| 32 |
| 33 Surface* surface() { return surface_.get(); } |
| 34 ShellSurface* shell_surface() { return shell_surface_.get(); } |
| 35 gfx::Point origin(); |
| 36 |
| 37 private: |
| 38 std::unique_ptr<Surface> surface_; |
| 39 std::unique_ptr<Buffer> buffer_; |
| 40 std::unique_ptr<ShellSurface> shell_surface_; |
| 41 }; |
| 42 |
| 21 // A helper class that does common initialization required for Exosphere. | 43 // A helper class that does common initialization required for Exosphere. |
| 22 class ExoTestHelper { | 44 class ExoTestHelper { |
| 23 public: | 45 public: |
| 24 ExoTestHelper(); | 46 ExoTestHelper(); |
| 25 ~ExoTestHelper(); | 47 ~ExoTestHelper(); |
| 26 | 48 |
| 27 // Creates a GpuMemoryBuffer instance that can be used for tests. | 49 // Creates a GpuMemoryBuffer instance that can be used for tests. |
| 28 std::unique_ptr<gfx::GpuMemoryBuffer> CreateGpuMemoryBuffer( | 50 std::unique_ptr<gfx::GpuMemoryBuffer> CreateGpuMemoryBuffer( |
| 29 const gfx::Size& size); | 51 const gfx::Size& size); |
| 30 | 52 |
| 53 // Creates window of size (width, height) at center of screen. |
| 54 ExoTestWindow CreateWindow(int width, int height, bool is_modal); |
| 55 |
| 31 private: | 56 private: |
| 32 DISALLOW_COPY_AND_ASSIGN(ExoTestHelper); | 57 DISALLOW_COPY_AND_ASSIGN(ExoTestHelper); |
| 33 }; | 58 }; |
| 34 | 59 |
| 35 } // namespace test | 60 } // namespace test |
| 36 } // namespace exo | 61 } // namespace exo |
| 37 | 62 |
| 38 #endif // COMPONENTS_EXO_TEST_EXO_TEST_HELPER_H_ | 63 #endif // COMPONENTS_EXO_TEST_EXO_TEST_HELPER_H_ |
| OLD | NEW |