Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(513)

Side by Side Diff: components/exo/sub_surface_unittest.cc

Issue 2257793002: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « components/exo/shared_memory_unittest.cc ('k') | components/exo/wayland/server.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « components/exo/shared_memory_unittest.cc ('k') | components/exo/wayland/server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698