| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ui/wm/core/window_modality_controller.h" | 5 #include "ui/wm/core/window_modality_controller.h" |
| 6 | 6 |
| 7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "ash/test/ash_test_base.h" | 8 #include "ash/test/ash_test_base.h" |
| 9 #include "ash/test/child_modal_window.h" | 9 #include "ash/test/child_modal_window.h" |
| 10 #include "ash/wm/window_util.h" | 10 #include "ash/wm/window_util.h" |
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 EXPECT_FALSE(view->got_capture_lost()); | 315 EXPECT_FALSE(view->got_capture_lost()); |
| 316 EXPECT_FALSE(view->got_press()); | 316 EXPECT_FALSE(view->got_press()); |
| 317 } | 317 } |
| 318 | 318 |
| 319 // Test that when a child modal window becomes visible, we only release the | 319 // Test that when a child modal window becomes visible, we only release the |
| 320 // capture window if the current capture window is in the hierarchy of the child | 320 // capture window if the current capture window is in the hierarchy of the child |
| 321 // modal window's modal parent window. | 321 // modal window's modal parent window. |
| 322 TEST_F(WindowModalityControllerTest, ReleaseCapture) { | 322 TEST_F(WindowModalityControllerTest, ReleaseCapture) { |
| 323 // Create a window hierachy like this: | 323 // Create a window hierachy like this: |
| 324 // w0 | 324 // w0 |
| 325 // / | \ | 325 // / | \ |
| 326 // w1 <------ w3 w2 | 326 // w1 <------ w3 w2 |
| 327 // | (modal to) | 327 // | (modal to) |
| 328 // w11 | 328 // w11 |
| 329 | 329 |
| 330 aura::test::TestWindowDelegate d; | 330 aura::test::TestWindowDelegate d; |
| 331 std::unique_ptr<aura::Window> w1( | 331 std::unique_ptr<aura::Window> w1( |
| 332 CreateTestWindowInShellWithDelegate(&d, -1, gfx::Rect())); | 332 CreateTestWindowInShellWithDelegate(&d, -1, gfx::Rect())); |
| 333 std::unique_ptr<aura::Window> w11( | 333 std::unique_ptr<aura::Window> w11( |
| 334 aura::test::CreateTestWindowWithDelegate(&d, -11, gfx::Rect(), w1.get())); | 334 aura::test::CreateTestWindowWithDelegate(&d, -11, gfx::Rect(), w1.get())); |
| 335 std::unique_ptr<aura::Window> w2( | 335 std::unique_ptr<aura::Window> w2( |
| (...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 642 EXPECT_TRUE(wm::IsActiveWindow(w4.get())); | 642 EXPECT_TRUE(wm::IsActiveWindow(w4.get())); |
| 643 | 643 |
| 644 wm::ActivateWindow(w3.get()); | 644 wm::ActivateWindow(w3.get()); |
| 645 EXPECT_TRUE(wm::IsActiveWindow(w4.get())); | 645 EXPECT_TRUE(wm::IsActiveWindow(w4.get())); |
| 646 | 646 |
| 647 wm::ActivateWindow(w4.get()); | 647 wm::ActivateWindow(w4.get()); |
| 648 EXPECT_TRUE(wm::IsActiveWindow(w4.get())); | 648 EXPECT_TRUE(wm::IsActiveWindow(w4.get())); |
| 649 } | 649 } |
| 650 | 650 |
| 651 } // namespace ash | 651 } // namespace ash |
| OLD | NEW |