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/shadow_controller.h" | 5 #include "ui/wm/core/shadow_controller.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "ui/aura/client/window_tree_client.h" | 11 #include "ui/aura/client/window_tree_client.h" |
12 #include "ui/aura/test/aura_test_base.h" | 12 #include "ui/aura/test/aura_test_base.h" |
13 #include "ui/aura/window.h" | 13 #include "ui/aura/window.h" |
14 #include "ui/aura/window_event_dispatcher.h" | 14 #include "ui/aura/window_event_dispatcher.h" |
15 #include "ui/compositor/layer.h" | 15 #include "ui/compositor/layer.h" |
| 16 #include "ui/wm/core/default_activation_client.h" |
16 #include "ui/wm/core/shadow.h" | 17 #include "ui/wm/core/shadow.h" |
17 #include "ui/wm/core/shadow_types.h" | 18 #include "ui/wm/core/shadow_types.h" |
18 #include "ui/wm/core/window_util.h" | 19 #include "ui/wm/core/window_util.h" |
19 #include "ui/wm/core/wm_state.h" | 20 #include "ui/wm/core/wm_state.h" |
20 #include "ui/wm/public/activation_client.h" | 21 #include "ui/wm/public/activation_client.h" |
21 | 22 |
22 namespace wm { | 23 namespace wm { |
23 | 24 |
24 class ShadowControllerTest : public aura::test::AuraTestBase { | 25 class ShadowControllerTest : public aura::test::AuraTestBase { |
25 public: | 26 public: |
26 ShadowControllerTest() {} | 27 ShadowControllerTest() {} |
27 virtual ~ShadowControllerTest() {} | 28 virtual ~ShadowControllerTest() {} |
28 | 29 |
29 virtual void SetUp() OVERRIDE { | 30 virtual void SetUp() OVERRIDE { |
30 wm_state_.reset(new wm::WMState); | 31 wm_state_.reset(new wm::WMState); |
31 AuraTestBase::SetUp(); | 32 AuraTestBase::SetUp(); |
| 33 new wm::DefaultActivationClient(root_window()); |
32 aura::client::ActivationClient* activation_client = | 34 aura::client::ActivationClient* activation_client = |
33 aura::client::GetActivationClient(root_window()); | 35 aura::client::GetActivationClient(root_window()); |
34 shadow_controller_.reset(new ShadowController(activation_client)); | 36 shadow_controller_.reset(new ShadowController(activation_client)); |
35 } | 37 } |
36 virtual void TearDown() OVERRIDE { | 38 virtual void TearDown() OVERRIDE { |
37 shadow_controller_.reset(); | 39 shadow_controller_.reset(); |
38 AuraTestBase::TearDown(); | 40 AuraTestBase::TearDown(); |
39 wm_state_.reset(); | 41 wm_state_.reset(); |
40 } | 42 } |
41 | 43 |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 AddTransientChild(window1.get(), window2.get()); | 210 AddTransientChild(window1.get(), window2.get()); |
209 aura::client::SetHideOnDeactivate(window2.get(), true); | 211 aura::client::SetHideOnDeactivate(window2.get(), true); |
210 window2->Show(); | 212 window2->Show(); |
211 ActivateWindow(window2.get()); | 213 ActivateWindow(window2.get()); |
212 | 214 |
213 // window1 is now inactive, but its shadow should still appear active. | 215 // window1 is now inactive, but its shadow should still appear active. |
214 EXPECT_EQ(Shadow::STYLE_ACTIVE, shadow1->style()); | 216 EXPECT_EQ(Shadow::STYLE_ACTIVE, shadow1->style()); |
215 } | 217 } |
216 | 218 |
217 } // namespace wm | 219 } // namespace wm |
OLD | NEW |