OLD | NEW |
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 "testing/gtest/include/gtest/gtest.h" | 5 #include "testing/gtest/include/gtest/gtest.h" |
6 #include "third_party/skia/include/core/SkSurface.h" | 6 #include "third_party/skia/include/core/SkSurface.h" |
7 #include "ui/ozone/platform/wayland/fake_server.h" | 7 #include "ui/ozone/platform/wayland/fake_server.h" |
8 #include "ui/ozone/platform/wayland/mock_platform_window_delegate.h" | 8 #include "ui/ozone/platform/wayland/mock_platform_window_delegate.h" |
9 #include "ui/ozone/platform/wayland/wayland_surface_factory.h" | 9 #include "ui/ozone/platform/wayland/wayland_surface_factory.h" |
10 #include "ui/ozone/platform/wayland/wayland_test.h" | 10 #include "ui/ozone/platform/wayland/wayland_test.h" |
11 #include "ui/ozone/platform/wayland/wayland_window.h" | 11 #include "ui/ozone/platform/wayland/wayland_window.h" |
12 #include "ui/ozone/public/surface_ozone_canvas.h" | 12 #include "ui/ozone/public/surface_ozone_canvas.h" |
13 | 13 |
14 using ::testing::Expectation; | 14 using ::testing::Expectation; |
15 using ::testing::SaveArg; | 15 using ::testing::SaveArg; |
16 using ::testing::_; | 16 using ::testing::_; |
17 | 17 |
18 namespace ui { | 18 namespace ui { |
19 | 19 |
20 class WaylandSurfaceFactoryTest : public WaylandTest { | 20 class WaylandSurfaceFactoryTest : public WaylandTest { |
21 public: | 21 public: |
22 WaylandSurfaceFactoryTest() : surface_factory(&display) {} | 22 WaylandSurfaceFactoryTest() : surface_factory(&connection) {} |
23 | 23 |
24 ~WaylandSurfaceFactoryTest() override {} | 24 ~WaylandSurfaceFactoryTest() override {} |
25 | 25 |
26 void SetUp() override { | 26 void SetUp() override { |
27 WaylandTest::SetUp(); | 27 WaylandTest::SetUp(); |
28 canvas = surface_factory.CreateCanvasForWidget(widget); | 28 canvas = surface_factory.CreateCanvasForWidget(widget); |
29 ASSERT_TRUE(canvas); | 29 ASSERT_TRUE(canvas); |
30 } | 30 } |
31 | 31 |
32 protected: | 32 protected: |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 Sync(); | 74 Sync(); |
75 | 75 |
76 ASSERT_TRUE(buffer_resource); | 76 ASSERT_TRUE(buffer_resource); |
77 wl_shm_buffer* buffer = wl_shm_buffer_get(buffer_resource); | 77 wl_shm_buffer* buffer = wl_shm_buffer_get(buffer_resource); |
78 ASSERT_TRUE(buffer); | 78 ASSERT_TRUE(buffer); |
79 EXPECT_EQ(wl_shm_buffer_get_width(buffer), 100); | 79 EXPECT_EQ(wl_shm_buffer_get_width(buffer), 100); |
80 EXPECT_EQ(wl_shm_buffer_get_height(buffer), 50); | 80 EXPECT_EQ(wl_shm_buffer_get_height(buffer), 50); |
81 } | 81 } |
82 | 82 |
83 } // namespace ui | 83 } // namespace ui |
OLD | NEW |