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 #include "base/message_loop/message_loop.h" | 5 #include "base/message_loop/message_loop.h" |
6 #include "base/strings/utf_string_conversions.h" | 6 #include "base/strings/utf_string_conversions.h" |
7 #include "components/exo/buffer.h" | 7 #include "components/exo/buffer.h" |
8 #include "components/exo/shell_surface.h" | 8 #include "components/exo/shell_surface.h" |
9 #include "components/exo/surface.h" | 9 #include "components/exo/surface.h" |
10 #include "components/exo/test/exo_test_base.h" | 10 #include "components/exo/test/exo_test_base.h" |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 surface->Attach(buffer.get()); | 203 surface->Attach(buffer.get()); |
204 surface->Commit(); | 204 surface->Commit(); |
205 EXPECT_EQ( | 205 EXPECT_EQ( |
206 geometry.size().ToString(), | 206 geometry.size().ToString(), |
207 shell_surface->GetWidget()->GetWindowBoundsInScreen().size().ToString()); | 207 shell_surface->GetWidget()->GetWindowBoundsInScreen().size().ToString()); |
208 EXPECT_EQ(gfx::Rect(gfx::Point() - geometry.OffsetFromOrigin(), buffer_size) | 208 EXPECT_EQ(gfx::Rect(gfx::Point() - geometry.OffsetFromOrigin(), buffer_size) |
209 .ToString(), | 209 .ToString(), |
210 surface->bounds().ToString()); | 210 surface->bounds().ToString()); |
211 } | 211 } |
212 | 212 |
213 TEST_F(ShellSurfaceTest, SetScale) { | 213 TEST_P(ShellSurfaceTest, SetScale) { |
214 gfx::Size buffer_size(64, 64); | 214 gfx::Size buffer_size(64, 64); |
215 std::unique_ptr<Buffer> buffer( | 215 std::unique_ptr<Buffer> buffer( |
216 new Buffer(exo_test_helper()->CreateGpuMemoryBuffer(buffer_size))); | 216 new Buffer(exo_test_helper()->CreateGpuMemoryBuffer(buffer_size))); |
217 std::unique_ptr<Surface> surface(new Surface); | 217 std::unique_ptr<Surface> surface(new Surface); |
218 std::unique_ptr<ShellSurface> shell_surface(new ShellSurface(surface.get())); | 218 std::unique_ptr<ShellSurface> shell_surface(new ShellSurface(surface.get())); |
219 | 219 |
220 double scale = 1.5; | 220 double scale = 1.5; |
221 shell_surface->SetScale(scale); | 221 shell_surface->SetScale(scale); |
222 surface->Attach(buffer.get()); | 222 surface->Attach(buffer.get()); |
223 surface->Commit(); | 223 surface->Commit(); |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 EXPECT_FALSE(is_resizing); | 322 EXPECT_FALSE(is_resizing); |
323 shell_surface->Resize(HTBOTTOMRIGHT); | 323 shell_surface->Resize(HTBOTTOMRIGHT); |
324 shell_surface->AcknowledgeConfigure(0); | 324 shell_surface->AcknowledgeConfigure(0); |
325 EXPECT_TRUE(is_resizing); | 325 EXPECT_TRUE(is_resizing); |
326 } | 326 } |
327 | 327 |
328 INSTANTIATE_TEST_CASE_P(, ShellSurfaceTest, ::testing::Bool()); | 328 INSTANTIATE_TEST_CASE_P(, ShellSurfaceTest, ::testing::Bool()); |
329 | 329 |
330 } // namespace | 330 } // namespace |
331 } // namespace exo | 331 } // namespace exo |
OLD | NEW |