| 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 "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 Loading... |
| 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(), gfx::Point(), | 150 surface1.get(), ash::kShellWindowId_SystemModalContainer); |
| 151 ash::kShellWindowId_SystemModalContainer); | |
| 152 EXPECT_TRUE(shell_surface1); | 151 EXPECT_TRUE(shell_surface1); |
| 153 | 152 |
| 154 // Create a remote shell surface for surface2. | 153 // Create a remote shell surface for surface2. |
| 155 std::unique_ptr<ShellSurface> shell_surface2 = | 154 std::unique_ptr<ShellSurface> shell_surface2 = |
| 156 display->CreateRemoteShellSurface(surface2.get(), gfx::Point(), | 155 display->CreateRemoteShellSurface(surface2.get(), |
| 157 ash::kShellWindowId_DefaultContainer); | 156 ash::kShellWindowId_DefaultContainer); |
| 158 EXPECT_TRUE(shell_surface2); | 157 EXPECT_TRUE(shell_surface2); |
| 159 } | 158 } |
| 160 | 159 |
| 161 TEST_F(DisplayTest, CreateSubSurface) { | 160 TEST_F(DisplayTest, CreateSubSurface) { |
| 162 std::unique_ptr<Display> display(new Display); | 161 std::unique_ptr<Display> display(new Display); |
| 163 | 162 |
| 164 // Create child, parent and toplevel surfaces. | 163 // Create child, parent and toplevel surfaces. |
| 165 std::unique_ptr<Surface> child = display->CreateSurface(); | 164 std::unique_ptr<Surface> child = display->CreateSurface(); |
| 166 ASSERT_TRUE(child); | 165 ASSERT_TRUE(child); |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 // Attempting to create a sub surface for parent with grandchild as its parent | 217 // Attempting to create a sub surface for parent with grandchild as its parent |
| 219 // should fail. | 218 // should fail. |
| 220 EXPECT_FALSE(display->CreateSubSurface(parent.get(), grandchild.get())); | 219 EXPECT_FALSE(display->CreateSubSurface(parent.get(), grandchild.get())); |
| 221 | 220 |
| 222 // Create a sub surface for parent. | 221 // Create a sub surface for parent. |
| 223 EXPECT_TRUE(display->CreateSubSurface(parent.get(), toplevel.get())); | 222 EXPECT_TRUE(display->CreateSubSurface(parent.get(), toplevel.get())); |
| 224 } | 223 } |
| 225 | 224 |
| 226 } // namespace | 225 } // namespace |
| 227 } // namespace exo | 226 } // namespace exo |
| OLD | NEW |