| 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 "components/exo/sub_surface.h" | 5 #include "components/exo/sub_surface.h" |
| 6 | 6 |
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "components/exo/surface.h" | 8 #include "components/exo/surface.h" |
| 9 #include "components/exo/test/exo_test_base.h" | 9 #include "components/exo/test/exo_test_base.h" |
| 10 #include "components/exo/test/exo_test_helper.h" | 10 #include "components/exo/test/exo_test_helper.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 EXPECT_EQ(gfx::Point().ToString(), | 33 EXPECT_EQ(gfx::Point().ToString(), |
| 34 surface->window()->bounds().origin().ToString()); | 34 surface->window()->bounds().origin().ToString()); |
| 35 | 35 |
| 36 // Check that position is updated when Commit() is called. | 36 // Check that position is updated when Commit() is called. |
| 37 parent->Commit(); | 37 parent->Commit(); |
| 38 EXPECT_EQ(position.ToString(), | 38 EXPECT_EQ(position.ToString(), |
| 39 surface->window()->bounds().origin().ToString()); | 39 surface->window()->bounds().origin().ToString()); |
| 40 | 40 |
| 41 // Create and commit a new sub-surface using the same surface. | 41 // Create and commit a new sub-surface using the same surface. |
| 42 sub_surface.reset(); | 42 sub_surface.reset(); |
| 43 sub_surface = base::WrapUnique(new SubSurface(surface.get(), parent.get())); | 43 sub_surface = base::MakeUnique<SubSurface>(surface.get(), parent.get()); |
| 44 parent->Commit(); | 44 parent->Commit(); |
| 45 | 45 |
| 46 // Initial position should be reset to origin. | 46 // Initial position should be reset to origin. |
| 47 EXPECT_EQ(gfx::Point().ToString(), | 47 EXPECT_EQ(gfx::Point().ToString(), |
| 48 surface->window()->bounds().origin().ToString()); | 48 surface->window()->bounds().origin().ToString()); |
| 49 } | 49 } |
| 50 | 50 |
| 51 TEST_F(SubSurfaceTest, PlaceAbove) { | 51 TEST_F(SubSurfaceTest, PlaceAbove) { |
| 52 std::unique_ptr<Surface> parent(new Surface); | 52 std::unique_ptr<Surface> parent(new Surface); |
| 53 std::unique_ptr<Surface> surface1(new Surface); | 53 std::unique_ptr<Surface> surface1(new Surface); |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 child->Commit(); | 151 child->Commit(); |
| 152 | 152 |
| 153 // A Commit() call on child should be sufficient for the position of | 153 // A Commit() call on child should be sufficient for the position of |
| 154 // grandchild to take effect when synchronous is disabled. | 154 // grandchild to take effect when synchronous is disabled. |
| 155 EXPECT_EQ(position2.ToString(), | 155 EXPECT_EQ(position2.ToString(), |
| 156 grandchild->window()->bounds().origin().ToString()); | 156 grandchild->window()->bounds().origin().ToString()); |
| 157 } | 157 } |
| 158 | 158 |
| 159 } // namespace | 159 } // namespace |
| 160 } // namespace exo | 160 } // namespace exo |
| OLD | NEW |