| 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/root_window_controller.h" | 5 #include "ash/root_window_controller.h" |
| 6 | 6 |
| 7 #include "ash/session_state_delegate.h" | 7 #include "ash/session_state_delegate.h" |
| 8 #include "ash/shelf/shelf_layout_manager.h" | 8 #include "ash/shelf/shelf_layout_manager.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 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 522 }; | 522 }; |
| 523 | 523 |
| 524 // Verifies shutdown doesn't delete windows that are not owned by the parent. | 524 // Verifies shutdown doesn't delete windows that are not owned by the parent. |
| 525 TEST_F(RootWindowControllerTest, DontDeleteWindowsNotOwnedByParent) { | 525 TEST_F(RootWindowControllerTest, DontDeleteWindowsNotOwnedByParent) { |
| 526 DestroyedWindowObserver observer1; | 526 DestroyedWindowObserver observer1; |
| 527 aura::test::TestWindowDelegate delegate1; | 527 aura::test::TestWindowDelegate delegate1; |
| 528 aura::Window* window1 = new aura::Window(&delegate1); | 528 aura::Window* window1 = new aura::Window(&delegate1); |
| 529 window1->SetType(ui::wm::WINDOW_TYPE_CONTROL); | 529 window1->SetType(ui::wm::WINDOW_TYPE_CONTROL); |
| 530 window1->set_owned_by_parent(false); | 530 window1->set_owned_by_parent(false); |
| 531 observer1.SetWindow(window1); | 531 observer1.SetWindow(window1); |
| 532 window1->Init(ui::LAYER_NOT_DRAWN); | 532 window1->Init(aura::WINDOW_LAYER_NOT_DRAWN); |
| 533 aura::client::ParentWindowWithContext( | 533 aura::client::ParentWindowWithContext( |
| 534 window1, Shell::GetInstance()->GetPrimaryRootWindow(), gfx::Rect()); | 534 window1, Shell::GetInstance()->GetPrimaryRootWindow(), gfx::Rect()); |
| 535 | 535 |
| 536 DestroyedWindowObserver observer2; | 536 DestroyedWindowObserver observer2; |
| 537 aura::Window* window2 = new aura::Window(NULL); | 537 aura::Window* window2 = new aura::Window(NULL); |
| 538 window2->set_owned_by_parent(false); | 538 window2->set_owned_by_parent(false); |
| 539 observer2.SetWindow(window2); | 539 observer2.SetWindow(window2); |
| 540 window2->Init(ui::LAYER_NOT_DRAWN); | 540 window2->Init(aura::WINDOW_LAYER_NOT_DRAWN); |
| 541 Shell::GetInstance()->GetPrimaryRootWindow()->AddChild(window2); | 541 Shell::GetInstance()->GetPrimaryRootWindow()->AddChild(window2); |
| 542 | 542 |
| 543 Shell::GetInstance()->GetPrimaryRootWindowController()->CloseChildWindows(); | 543 Shell::GetInstance()->GetPrimaryRootWindowController()->CloseChildWindows(); |
| 544 | 544 |
| 545 ASSERT_FALSE(observer1.destroyed()); | 545 ASSERT_FALSE(observer1.destroyed()); |
| 546 delete window1; | 546 delete window1; |
| 547 | 547 |
| 548 ASSERT_FALSE(observer2.destroyed()); | 548 ASSERT_FALSE(observer2.destroyed()); |
| 549 delete window2; | 549 delete window2; |
| 550 } | 550 } |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 656 aura::WindowTracker tracker; | 656 aura::WindowTracker tracker; |
| 657 tracker.Add(keyboard_container); | 657 tracker.Add(keyboard_container); |
| 658 // Mock a login user profile change to reinitialize the keyboard. | 658 // Mock a login user profile change to reinitialize the keyboard. |
| 659 ash::Shell::GetInstance()->OnLoginUserProfilePrepared(); | 659 ash::Shell::GetInstance()->OnLoginUserProfilePrepared(); |
| 660 // keyboard_container should no longer be present. | 660 // keyboard_container should no longer be present. |
| 661 EXPECT_FALSE(tracker.Contains(keyboard_container)); | 661 EXPECT_FALSE(tracker.Contains(keyboard_container)); |
| 662 } | 662 } |
| 663 | 663 |
| 664 } // namespace test | 664 } // namespace test |
| 665 } // namespace ash | 665 } // namespace ash |
| OLD | NEW |