OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/aura_shell/stacking_controller.h" | 5 #include "ui/aura_shell/stacking_controller.h" |
6 | 6 |
7 #include "ui/aura/desktop.h" | 7 #include "ui/aura/desktop.h" |
8 #include "ui/aura/test/aura_test_base.h" | 8 #include "ui/aura/test/aura_test_base.h" |
9 #include "ui/aura/test/test_windows.h" | 9 #include "ui/aura/test/test_windows.h" |
10 #include "ui/aura/test/test_window_delegate.h" | 10 #include "ui/aura/test/test_window_delegate.h" |
11 #include "ui/aura_shell/shell.h" | 11 #include "ui/aura_shell/shell.h" |
12 | 12 |
13 namespace aura_shell { | 13 namespace aura_shell { |
14 namespace test { | 14 namespace test { |
15 | 15 |
16 typedef aura::test::AuraTestBase StackingControllerTest; | 16 typedef aura::test::AuraTestBase StackingControllerTest; |
17 | 17 |
18 TEST_F(StackingControllerTest, GetTopmostWindowToActivate) { | 18 TEST_F(StackingControllerTest, GetTopmostWindowToActivate) { |
19 Shell::GetInstance(); | 19 Shell::CreateInstance(NULL); |
20 aura::test::ActivateWindowDelegate activate; | 20 aura::test::ActivateWindowDelegate activate; |
21 aura::test::ActivateWindowDelegate non_activate(false); | 21 aura::test::ActivateWindowDelegate non_activate(false); |
22 | 22 |
23 scoped_ptr<aura::Window> w1(aura::test::CreateTestWindowWithDelegate( | 23 scoped_ptr<aura::Window> w1(aura::test::CreateTestWindowWithDelegate( |
24 &non_activate, 1, gfx::Rect(), NULL)); | 24 &non_activate, 1, gfx::Rect(), NULL)); |
25 scoped_ptr<aura::Window> w2(aura::test::CreateTestWindowWithDelegate( | 25 scoped_ptr<aura::Window> w2(aura::test::CreateTestWindowWithDelegate( |
26 &activate, 2, gfx::Rect(), NULL)); | 26 &activate, 2, gfx::Rect(), NULL)); |
27 scoped_ptr<aura::Window> w3(aura::test::CreateTestWindowWithDelegate( | 27 scoped_ptr<aura::Window> w3(aura::test::CreateTestWindowWithDelegate( |
28 &non_activate, 3, gfx::Rect(), NULL)); | 28 &non_activate, 3, gfx::Rect(), NULL)); |
29 EXPECT_EQ(w2.get(), aura::Desktop::GetInstance()->stacking_client()-> | 29 EXPECT_EQ(w2.get(), aura::Desktop::GetInstance()->stacking_client()-> |
30 GetTopmostWindowToActivate(NULL)); | 30 GetTopmostWindowToActivate(NULL)); |
31 } | 31 } |
32 | 32 |
33 } // namespace test | 33 } // namespace test |
34 } // namespace aura_shell | 34 } // namespace aura_shell |
OLD | NEW |