| 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/common/wm/window_positioning_utils.h" | 5 #include "ash/common/wm/window_positioning_utils.h" |
| 6 #include "ash/common/wm_shell.h" | 6 #include "ash/common/wm_shell.h" |
| 7 #include "ash/common/wm_window.h" | 7 #include "ash/common/wm_window.h" |
| 8 #include "ash/public/cpp/shell_window_ids.h" | 8 #include "ash/public/cpp/shell_window_ids.h" |
| 9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "components/exo/buffer.h" | 10 #include "components/exo/buffer.h" |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 EXPECT_CALL(delegate, OnPointerLeave(surface.get())); | 168 EXPECT_CALL(delegate, OnPointerLeave(surface.get())); |
| 169 EXPECT_CALL(delegate, OnPointerEnter(sub_surface.get(), gfx::PointF(), 0)); | 169 EXPECT_CALL(delegate, OnPointerEnter(sub_surface.get(), gfx::PointF(), 0)); |
| 170 generator.MoveMouseTo(sub_surface->window()->GetBoundsInScreen().origin()); | 170 generator.MoveMouseTo(sub_surface->window()->GetBoundsInScreen().origin()); |
| 171 | 171 |
| 172 EXPECT_CALL(delegate, OnPointerMotion(testing::_, gfx::PointF(1, 1))); | 172 EXPECT_CALL(delegate, OnPointerMotion(testing::_, gfx::PointF(1, 1))); |
| 173 generator.MoveMouseTo(sub_surface->window()->GetBoundsInScreen().origin() + | 173 generator.MoveMouseTo(sub_surface->window()->GetBoundsInScreen().origin() + |
| 174 gfx::Vector2d(1, 1)); | 174 gfx::Vector2d(1, 1)); |
| 175 | 175 |
| 176 std::unique_ptr<Surface> child_surface(new Surface); | 176 std::unique_ptr<Surface> child_surface(new Surface); |
| 177 std::unique_ptr<ShellSurface> child_shell_surface(new ShellSurface( | 177 std::unique_ptr<ShellSurface> child_shell_surface(new ShellSurface( |
| 178 child_surface.get(), shell_surface.get(), gfx::Rect(9, 9, 1, 1), true, | 178 child_surface.get(), shell_surface.get(), ShellSurface::BoundsMode::FIXED, |
| 179 false, ash::kShellWindowId_DefaultContainer)); | 179 gfx::Point(9, 9), true, false, ash::kShellWindowId_DefaultContainer)); |
| 180 gfx::Size child_buffer_size(15, 15); | 180 gfx::Size child_buffer_size(15, 15); |
| 181 std::unique_ptr<Buffer> child_buffer( | 181 std::unique_ptr<Buffer> child_buffer( |
| 182 new Buffer(exo_test_helper()->CreateGpuMemoryBuffer(child_buffer_size))); | 182 new Buffer(exo_test_helper()->CreateGpuMemoryBuffer(child_buffer_size))); |
| 183 child_surface->Attach(child_buffer.get()); | 183 child_surface->Attach(child_buffer.get()); |
| 184 child_surface->Commit(); | 184 child_surface->Commit(); |
| 185 | 185 |
| 186 EXPECT_CALL(delegate, CanAcceptPointerEventsForSurface(child_surface.get())) | 186 EXPECT_CALL(delegate, CanAcceptPointerEventsForSurface(child_surface.get())) |
| 187 .WillRepeatedly(testing::Return(true)); | 187 .WillRepeatedly(testing::Return(true)); |
| 188 | 188 |
| 189 EXPECT_CALL(delegate, OnPointerLeave(sub_surface.get())); | 189 EXPECT_CALL(delegate, OnPointerLeave(sub_surface.get())); |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 surface->Attach(buffer.get()); | 300 surface->Attach(buffer.get()); |
| 301 surface->Commit(); | 301 surface->Commit(); |
| 302 gfx::Point location = surface->window()->GetBoundsInScreen().origin(); | 302 gfx::Point location = surface->window()->GetBoundsInScreen().origin(); |
| 303 | 303 |
| 304 MockPointerDelegate delegate; | 304 MockPointerDelegate delegate; |
| 305 std::unique_ptr<Pointer> pointer(new Pointer(&delegate)); | 305 std::unique_ptr<Pointer> pointer(new Pointer(&delegate)); |
| 306 ui::test::EventGenerator generator(ash::Shell::GetPrimaryRootWindow()); | 306 ui::test::EventGenerator generator(ash::Shell::GetPrimaryRootWindow()); |
| 307 | 307 |
| 308 // Create surface for modal window. | 308 // Create surface for modal window. |
| 309 std::unique_ptr<Surface> surface2(new Surface); | 309 std::unique_ptr<Surface> surface2(new Surface); |
| 310 std::unique_ptr<ShellSurface> shell_surface2( | 310 std::unique_ptr<ShellSurface> shell_surface2(new ShellSurface( |
| 311 new ShellSurface(surface2.get(), nullptr, gfx::Rect(0, 0, 5, 5), true, | 311 surface2.get(), nullptr, ShellSurface::BoundsMode::FIXED, gfx::Point(), |
| 312 false, ash::kShellWindowId_SystemModalContainer)); | 312 true, false, ash::kShellWindowId_SystemModalContainer)); |
| 313 std::unique_ptr<Buffer> buffer2( | 313 std::unique_ptr<Buffer> buffer2( |
| 314 new Buffer(exo_test_helper()->CreateGpuMemoryBuffer(gfx::Size(5, 5)))); | 314 new Buffer(exo_test_helper()->CreateGpuMemoryBuffer(gfx::Size(5, 5)))); |
| 315 surface2->Attach(buffer2.get()); | 315 surface2->Attach(buffer2.get()); |
| 316 surface2->Commit(); | 316 surface2->Commit(); |
| 317 ash::wm::CenterWindow(ash::WmWindow::Get(surface2->window())); | 317 ash::wm::CenterWindow(ash::WmWindow::Get(surface2->window())); |
| 318 gfx::Point location2 = surface2->window()->GetBoundsInScreen().origin(); | 318 gfx::Point location2 = surface2->window()->GetBoundsInScreen().origin(); |
| 319 | 319 |
| 320 // Make the window modal. | 320 // Make the window modal. |
| 321 shell_surface2->SetSystemModal(true); | 321 shell_surface2->SetSystemModal(true); |
| 322 EXPECT_TRUE(ash::WmShell::Get()->IsSystemModalWindowOpen()); | 322 EXPECT_TRUE(ash::WmShell::Get()->IsSystemModalWindowOpen()); |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 446 EXPECT_CALL(delegate, OnPointerLeave(surface.get())); | 446 EXPECT_CALL(delegate, OnPointerLeave(surface.get())); |
| 447 } | 447 } |
| 448 generator.MoveMouseTo(surface->window()->GetBoundsInScreen().bottom_right()); | 448 generator.MoveMouseTo(surface->window()->GetBoundsInScreen().bottom_right()); |
| 449 | 449 |
| 450 EXPECT_CALL(delegate, OnPointerDestroying(pointer.get())); | 450 EXPECT_CALL(delegate, OnPointerDestroying(pointer.get())); |
| 451 pointer.reset(); | 451 pointer.reset(); |
| 452 } | 452 } |
| 453 | 453 |
| 454 } // namespace | 454 } // namespace |
| 455 } // namespace exo | 455 } // namespace exo |
| OLD | NEW |