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 "ash/wm/system_modal_container_layout_manager.h" | 5 #include "ash/wm/system_modal_container_layout_manager.h" |
6 | 6 |
7 #include "ash/root_window_controller.h" | 7 #include "ash/root_window_controller.h" |
8 #include "ash/session/session_state_delegate.h" | 8 #include "ash/session/session_state_delegate.h" |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "ash/shell_window_ids.h" | 10 #include "ash/shell_window_ids.h" |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 e1.ClickLeftButton(); | 268 e1.ClickLeftButton(); |
269 EXPECT_TRUE(wm::IsActiveWindow(t1.get())); | 269 EXPECT_TRUE(wm::IsActiveWindow(t1.get())); |
270 | 270 |
271 // Now open another modal transient parented to the original modal transient. | 271 // Now open another modal transient parented to the original modal transient. |
272 aura::Window* t2 = OpenTestWindowWithParent(t1.get(), true); | 272 aura::Window* t2 = OpenTestWindowWithParent(t1.get(), true); |
273 TransientWindowObserver do2; | 273 TransientWindowObserver do2; |
274 t2->AddObserver(&do2); | 274 t2->AddObserver(&do2); |
275 | 275 |
276 EXPECT_TRUE(wm::IsActiveWindow(t2)); | 276 EXPECT_TRUE(wm::IsActiveWindow(t2)); |
277 | 277 |
278 EXPECT_EQ(t1, ::wm::GetTransientParent(t2)); | 278 EXPECT_EQ(t1.get(), ::wm::GetTransientParent(t2)); |
279 EXPECT_EQ(GetModalContainer(), t2->parent()); | 279 EXPECT_EQ(GetModalContainer(), t2->parent()); |
280 | 280 |
281 // t2 should still be active, even after clicking on t1. | 281 // t2 should still be active, even after clicking on t1. |
282 ui::test::EventGenerator e2(Shell::GetPrimaryRootWindow(), t1.get()); | 282 ui::test::EventGenerator e2(Shell::GetPrimaryRootWindow(), t1.get()); |
283 e2.ClickLeftButton(); | 283 e2.ClickLeftButton(); |
284 EXPECT_TRUE(wm::IsActiveWindow(t2)); | 284 EXPECT_TRUE(wm::IsActiveWindow(t2)); |
285 | 285 |
286 // Both transients should be destroyed with parent. | 286 // Both transients should be destroyed with parent. |
287 t1.reset(); | 287 t1.reset(); |
288 EXPECT_TRUE(do1.destroyed()); | 288 EXPECT_TRUE(do1.destroyed()); |
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
644 ShowKeyboard(true); | 644 ShowKeyboard(true); |
645 EXPECT_EQ(modal_size.ToString(), modal_window->bounds().size().ToString()); | 645 EXPECT_EQ(modal_size.ToString(), modal_window->bounds().size().ToString()); |
646 EXPECT_EQ(modal_origin.x(), modal_window->bounds().x()); | 646 EXPECT_EQ(modal_origin.x(), modal_window->bounds().x()); |
647 EXPECT_EQ(0, modal_window->bounds().y()); | 647 EXPECT_EQ(0, modal_window->bounds().y()); |
648 | 648 |
649 ShowKeyboard(false); | 649 ShowKeyboard(false); |
650 } | 650 } |
651 | 651 |
652 } // namespace test | 652 } // namespace test |
653 } // namespace ash | 653 } // namespace ash |
OLD | NEW |