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

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

Issue 2706543002: exo: Synchronize multi-display window positioning (Closed)
Patch Set: Address nit Created 3 years, 10 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/display.cc ('k') | components/exo/shell_surface.h » ('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 "ash/public/cpp/shell_window_ids.h" 5 #include "ash/public/cpp/shell_window_ids.h"
6 #include "components/exo/buffer.h" 6 #include "components/exo/buffer.h"
7 #include "components/exo/display.h" 7 #include "components/exo/display.h"
8 #include "components/exo/shared_memory.h" 8 #include "components/exo/shared_memory.h"
9 #include "components/exo/shell_surface.h" 9 #include "components/exo/shell_surface.h"
10 #include "components/exo/sub_surface.h" 10 #include "components/exo/sub_surface.h"
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 140
141 // Create two surfaces. 141 // Create two surfaces.
142 std::unique_ptr<Surface> surface1 = display->CreateSurface(); 142 std::unique_ptr<Surface> surface1 = display->CreateSurface();
143 ASSERT_TRUE(surface1); 143 ASSERT_TRUE(surface1);
144 std::unique_ptr<Surface> surface2 = display->CreateSurface(); 144 std::unique_ptr<Surface> surface2 = display->CreateSurface();
145 ASSERT_TRUE(surface2); 145 ASSERT_TRUE(surface2);
146 146
147 // Create a remote shell surface for surface1. 147 // Create a remote shell surface for surface1.
148 std::unique_ptr<ShellSurface> shell_surface1 = 148 std::unique_ptr<ShellSurface> shell_surface1 =
149 display->CreateRemoteShellSurface( 149 display->CreateRemoteShellSurface(
150 surface1.get(), ash::kShellWindowId_SystemModalContainer); 150 surface1.get(), gfx::Point(),
151 ash::kShellWindowId_SystemModalContainer);
151 EXPECT_TRUE(shell_surface1); 152 EXPECT_TRUE(shell_surface1);
152 153
153 // Create a remote shell surface for surface2. 154 // Create a remote shell surface for surface2.
154 std::unique_ptr<ShellSurface> shell_surface2 = 155 std::unique_ptr<ShellSurface> shell_surface2 =
155 display->CreateRemoteShellSurface(surface2.get(), 156 display->CreateRemoteShellSurface(surface2.get(), gfx::Point(),
156 ash::kShellWindowId_DefaultContainer); 157 ash::kShellWindowId_DefaultContainer);
157 EXPECT_TRUE(shell_surface2); 158 EXPECT_TRUE(shell_surface2);
158 } 159 }
159 160
160 TEST_F(DisplayTest, CreateSubSurface) { 161 TEST_F(DisplayTest, CreateSubSurface) {
161 std::unique_ptr<Display> display(new Display); 162 std::unique_ptr<Display> display(new Display);
162 163
163 // Create child, parent and toplevel surfaces. 164 // Create child, parent and toplevel surfaces.
164 std::unique_ptr<Surface> child = display->CreateSurface(); 165 std::unique_ptr<Surface> child = display->CreateSurface();
165 ASSERT_TRUE(child); 166 ASSERT_TRUE(child);
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 // Attempting to create a sub surface for parent with grandchild as its parent 218 // Attempting to create a sub surface for parent with grandchild as its parent
218 // should fail. 219 // should fail.
219 EXPECT_FALSE(display->CreateSubSurface(parent.get(), grandchild.get())); 220 EXPECT_FALSE(display->CreateSubSurface(parent.get(), grandchild.get()));
220 221
221 // Create a sub surface for parent. 222 // Create a sub surface for parent.
222 EXPECT_TRUE(display->CreateSubSurface(parent.get(), toplevel.get())); 223 EXPECT_TRUE(display->CreateSubSurface(parent.get(), toplevel.get()));
223 } 224 }
224 225
225 } // namespace 226 } // namespace
226 } // namespace exo 227 } // namespace exo
OLDNEW
« no previous file with comments | « components/exo/display.cc ('k') | components/exo/shell_surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698