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/aura/wm_window_aura.h" |
5 #include "ash/common/shell_window_ids.h" | 6 #include "ash/common/shell_window_ids.h" |
| 7 #include "ash/common/wm/window_positioning_utils.h" |
6 #include "ash/common/wm_shell.h" | 8 #include "ash/common/wm_shell.h" |
7 #include "ash/shell.h" | 9 #include "ash/shell.h" |
8 #include "ash/wm/window_util.h" | |
9 #include "components/exo/buffer.h" | 10 #include "components/exo/buffer.h" |
10 #include "components/exo/pointer.h" | 11 #include "components/exo/pointer.h" |
11 #include "components/exo/pointer_delegate.h" | 12 #include "components/exo/pointer_delegate.h" |
12 #include "components/exo/shell_surface.h" | 13 #include "components/exo/shell_surface.h" |
13 #include "components/exo/surface.h" | 14 #include "components/exo/surface.h" |
14 #include "components/exo/test/exo_test_base.h" | 15 #include "components/exo/test/exo_test_base.h" |
15 #include "components/exo/test/exo_test_helper.h" | 16 #include "components/exo/test/exo_test_helper.h" |
16 #include "testing/gmock/include/gmock/gmock.h" | 17 #include "testing/gmock/include/gmock/gmock.h" |
17 #include "ui/events/event_utils.h" | 18 #include "ui/events/event_utils.h" |
18 #include "ui/events/test/event_generator.h" | 19 #include "ui/events/test/event_generator.h" |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 | 307 |
307 // Create surface for modal window. | 308 // Create surface for modal window. |
308 std::unique_ptr<Surface> surface2(new Surface); | 309 std::unique_ptr<Surface> surface2(new Surface); |
309 std::unique_ptr<ShellSurface> shell_surface2( | 310 std::unique_ptr<ShellSurface> shell_surface2( |
310 new ShellSurface(surface2.get(), nullptr, gfx::Rect(0, 0, 5, 5), true, | 311 new ShellSurface(surface2.get(), nullptr, gfx::Rect(0, 0, 5, 5), true, |
311 ash::kShellWindowId_SystemModalContainer)); | 312 ash::kShellWindowId_SystemModalContainer)); |
312 std::unique_ptr<Buffer> buffer2( | 313 std::unique_ptr<Buffer> buffer2( |
313 new Buffer(exo_test_helper()->CreateGpuMemoryBuffer(gfx::Size(5, 5)))); | 314 new Buffer(exo_test_helper()->CreateGpuMemoryBuffer(gfx::Size(5, 5)))); |
314 surface2->Attach(buffer2.get()); | 315 surface2->Attach(buffer2.get()); |
315 surface2->Commit(); | 316 surface2->Commit(); |
316 ash::wm::CenterWindow(surface2->window()); | 317 ash::wm::CenterWindow(ash::WmWindowAura::Get(surface2->window())); |
317 gfx::Point location2 = surface2->window()->GetBoundsInScreen().origin(); | 318 gfx::Point location2 = surface2->window()->GetBoundsInScreen().origin(); |
318 | 319 |
319 // Make the window modal. | 320 // Make the window modal. |
320 shell_surface2->SetSystemModal(true); | 321 shell_surface2->SetSystemModal(true); |
321 EXPECT_TRUE(ash::WmShell::Get()->IsSystemModalWindowOpen()); | 322 EXPECT_TRUE(ash::WmShell::Get()->IsSystemModalWindowOpen()); |
322 | 323 |
323 EXPECT_CALL(delegate, CanAcceptPointerEventsForSurface(surface.get())) | 324 EXPECT_CALL(delegate, CanAcceptPointerEventsForSurface(surface.get())) |
324 .WillRepeatedly(testing::Return(true)); | 325 .WillRepeatedly(testing::Return(true)); |
325 EXPECT_CALL(delegate, CanAcceptPointerEventsForSurface(surface2.get())) | 326 EXPECT_CALL(delegate, CanAcceptPointerEventsForSurface(surface2.get())) |
326 .WillRepeatedly(testing::Return(true)); | 327 .WillRepeatedly(testing::Return(true)); |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
444 EXPECT_CALL(delegate, OnPointerLeave(surface.get())); | 445 EXPECT_CALL(delegate, OnPointerLeave(surface.get())); |
445 } | 446 } |
446 generator.MoveMouseTo(surface->window()->GetBoundsInScreen().bottom_right()); | 447 generator.MoveMouseTo(surface->window()->GetBoundsInScreen().bottom_right()); |
447 | 448 |
448 EXPECT_CALL(delegate, OnPointerDestroying(pointer.get())); | 449 EXPECT_CALL(delegate, OnPointerDestroying(pointer.get())); |
449 pointer.reset(); | 450 pointer.reset(); |
450 } | 451 } |
451 | 452 |
452 } // namespace | 453 } // namespace |
453 } // namespace exo | 454 } // namespace exo |
OLD | NEW |