| 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" |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 window2->Show(); | 148 window2->Show(); |
| 149 ActivateWindow(window2.get()); | 149 ActivateWindow(window2.get()); |
| 150 | 150 |
| 151 // window1 is now inactive, so shadow should go inactive. | 151 // window1 is now inactive, so shadow should go inactive. |
| 152 Shadow* shadow2 = api.GetShadowForWindow(window2.get()); | 152 Shadow* shadow2 = api.GetShadowForWindow(window2.get()); |
| 153 ASSERT_TRUE(shadow2 != NULL); | 153 ASSERT_TRUE(shadow2 != NULL); |
| 154 EXPECT_EQ(Shadow::STYLE_INACTIVE, shadow1->style()); | 154 EXPECT_EQ(Shadow::STYLE_INACTIVE, shadow1->style()); |
| 155 EXPECT_EQ(Shadow::STYLE_ACTIVE, shadow2->style()); | 155 EXPECT_EQ(Shadow::STYLE_ACTIVE, shadow2->style()); |
| 156 } | 156 } |
| 157 | 157 |
| 158 // Tests that shadow gets updated when the window show state chagnes. | 158 // Tests that shadow gets updated when the window show state changes. |
| 159 TEST_F(ShadowControllerTest, ShowState) { | 159 TEST_F(ShadowControllerTest, ShowState) { |
| 160 ShadowController::TestApi api(shadow_controller()); | 160 ShadowController::TestApi api(shadow_controller()); |
| 161 | 161 |
| 162 scoped_ptr<aura::Window> window(new aura::Window(NULL)); | 162 scoped_ptr<aura::Window> window(new aura::Window(NULL)); |
| 163 window->SetType(ui::wm::WINDOW_TYPE_NORMAL); | 163 window->SetType(ui::wm::WINDOW_TYPE_NORMAL); |
| 164 window->Init(ui::LAYER_TEXTURED); | 164 window->Init(ui::LAYER_TEXTURED); |
| 165 ParentWindow(window.get()); | 165 ParentWindow(window.get()); |
| 166 window->Show(); | 166 window->Show(); |
| 167 | 167 |
| 168 Shadow* shadow = api.GetShadowForWindow(window.get()); | 168 Shadow* shadow = api.GetShadowForWindow(window.get()); |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 AddTransientChild(window1.get(), window2.get()); | 235 AddTransientChild(window1.get(), window2.get()); |
| 236 aura::client::SetHideOnDeactivate(window2.get(), true); | 236 aura::client::SetHideOnDeactivate(window2.get(), true); |
| 237 window2->Show(); | 237 window2->Show(); |
| 238 ActivateWindow(window2.get()); | 238 ActivateWindow(window2.get()); |
| 239 | 239 |
| 240 // window1 is now inactive, but its shadow should still appear active. | 240 // window1 is now inactive, but its shadow should still appear active. |
| 241 EXPECT_EQ(Shadow::STYLE_ACTIVE, shadow1->style()); | 241 EXPECT_EQ(Shadow::STYLE_ACTIVE, shadow1->style()); |
| 242 } | 242 } |
| 243 | 243 |
| 244 } // namespace wm | 244 } // namespace wm |
| OLD | NEW |