| 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/session_state_delegate.h" | 7 #include "ash/session/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 540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 551 }; | 551 }; |
| 552 | 552 |
| 553 // Verifies shutdown doesn't delete windows that are not owned by the parent. | 553 // Verifies shutdown doesn't delete windows that are not owned by the parent. |
| 554 TEST_F(RootWindowControllerTest, DontDeleteWindowsNotOwnedByParent) { | 554 TEST_F(RootWindowControllerTest, DontDeleteWindowsNotOwnedByParent) { |
| 555 DestroyedWindowObserver observer1; | 555 DestroyedWindowObserver observer1; |
| 556 aura::test::TestWindowDelegate delegate1; | 556 aura::test::TestWindowDelegate delegate1; |
| 557 aura::Window* window1 = new aura::Window(&delegate1); | 557 aura::Window* window1 = new aura::Window(&delegate1); |
| 558 window1->SetType(ui::wm::WINDOW_TYPE_CONTROL); | 558 window1->SetType(ui::wm::WINDOW_TYPE_CONTROL); |
| 559 window1->set_owned_by_parent(false); | 559 window1->set_owned_by_parent(false); |
| 560 observer1.SetWindow(window1); | 560 observer1.SetWindow(window1); |
| 561 window1->Init(aura::WINDOW_LAYER_NOT_DRAWN); | 561 window1->Init(ui::LAYER_NOT_DRAWN); |
| 562 aura::client::ParentWindowWithContext( | 562 aura::client::ParentWindowWithContext( |
| 563 window1, Shell::GetInstance()->GetPrimaryRootWindow(), gfx::Rect()); | 563 window1, Shell::GetInstance()->GetPrimaryRootWindow(), gfx::Rect()); |
| 564 | 564 |
| 565 DestroyedWindowObserver observer2; | 565 DestroyedWindowObserver observer2; |
| 566 aura::Window* window2 = new aura::Window(NULL); | 566 aura::Window* window2 = new aura::Window(NULL); |
| 567 window2->set_owned_by_parent(false); | 567 window2->set_owned_by_parent(false); |
| 568 observer2.SetWindow(window2); | 568 observer2.SetWindow(window2); |
| 569 window2->Init(aura::WINDOW_LAYER_NOT_DRAWN); | 569 window2->Init(ui::LAYER_NOT_DRAWN); |
| 570 Shell::GetInstance()->GetPrimaryRootWindow()->AddChild(window2); | 570 Shell::GetInstance()->GetPrimaryRootWindow()->AddChild(window2); |
| 571 | 571 |
| 572 Shell::GetInstance()->GetPrimaryRootWindowController()->CloseChildWindows(); | 572 Shell::GetInstance()->GetPrimaryRootWindowController()->CloseChildWindows(); |
| 573 | 573 |
| 574 ASSERT_FALSE(observer1.destroyed()); | 574 ASSERT_FALSE(observer1.destroyed()); |
| 575 delete window1; | 575 delete window1; |
| 576 | 576 |
| 577 ASSERT_FALSE(observer2.destroyed()); | 577 ASSERT_FALSE(observer2.destroyed()); |
| 578 delete window2; | 578 delete window2; |
| 579 } | 579 } |
| (...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 954 ASSERT_TRUE(keyboard_container); | 954 ASSERT_TRUE(keyboard_container); |
| 955 keyboard_container->Show(); | 955 keyboard_container->Show(); |
| 956 EXPECT_EQ("0,0 800x600", keyboard_container->bounds().ToString()); | 956 EXPECT_EQ("0,0 800x600", keyboard_container->bounds().ToString()); |
| 957 | 957 |
| 958 UpdateDisplay("600x800"); | 958 UpdateDisplay("600x800"); |
| 959 EXPECT_EQ("0,0 600x800", keyboard_container->bounds().ToString()); | 959 EXPECT_EQ("0,0 600x800", keyboard_container->bounds().ToString()); |
| 960 } | 960 } |
| 961 | 961 |
| 962 } // namespace test | 962 } // namespace test |
| 963 } // namespace ash | 963 } // namespace ash |
| OLD | NEW |