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" |
(...skipping 13 matching lines...) Expand all Loading... |
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: |
33 WaylandSurfaceFactory surface_factory; | 33 WaylandSurfaceFactory surface_factory; |
34 scoped_ptr<SurfaceOzoneCanvas> canvas; | 34 std::unique_ptr<SurfaceOzoneCanvas> canvas; |
35 | 35 |
36 private: | 36 private: |
37 DISALLOW_COPY_AND_ASSIGN(WaylandSurfaceFactoryTest); | 37 DISALLOW_COPY_AND_ASSIGN(WaylandSurfaceFactoryTest); |
38 }; | 38 }; |
39 | 39 |
40 TEST_F(WaylandSurfaceFactoryTest, Canvas) { | 40 TEST_F(WaylandSurfaceFactoryTest, Canvas) { |
41 canvas->GetSurface(); | 41 canvas->GetSurface(); |
42 canvas->PresentCanvas(gfx::Rect(5, 10, 20, 15)); | 42 canvas->PresentCanvas(gfx::Rect(5, 10, 20, 15)); |
43 | 43 |
44 Expectation damage = EXPECT_CALL(*surface, Damage(5, 10, 20, 15)); | 44 Expectation damage = EXPECT_CALL(*surface, Damage(5, 10, 20, 15)); |
(...skipping 29 matching lines...) Expand all 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 |