| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/system/chromeos/brightness/tray_brightness.h" | 5 #include "ash/system/chromeos/brightness/tray_brightness.h" |
| 6 | 6 |
| 7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "ash/system/tray/system_tray_delegate.h" | 8 #include "ash/system/tray/system_tray_delegate.h" |
| 9 #include "ash/system/tray/system_tray_item.h" | 9 #include "ash/system/tray/system_tray_item.h" |
| 10 #include "ash/test/ash_test_base.h" | 10 #include "ash/test/ash_test_base.h" |
| 11 #include "ui/views/view.h" | 11 #include "ui/views/view.h" |
| 12 | 12 |
| 13 namespace ash { | 13 namespace ash { |
| 14 | |
| 15 namespace { | 14 namespace { |
| 16 | 15 |
| 17 user::LoginStatus GetUserLoginStatus() { | 16 user::LoginStatus GetUserLoginStatus() { |
| 18 return Shell::GetInstance()->system_tray_delegate()->GetUserLoginStatus(); | 17 return Shell::GetInstance()->system_tray_delegate()->GetUserLoginStatus(); |
| 19 } | 18 } |
| 20 | 19 |
| 21 } // namespace | 20 } // namespace |
| 22 | 21 |
| 23 namespace internal { | |
| 24 | |
| 25 class TrayBrightnessTest : public test::AshTestBase { | 22 class TrayBrightnessTest : public test::AshTestBase { |
| 26 public: | 23 public: |
| 27 TrayBrightnessTest() {} | 24 TrayBrightnessTest() {} |
| 28 virtual ~TrayBrightnessTest() {} | 25 virtual ~TrayBrightnessTest() {} |
| 29 | 26 |
| 30 protected: | 27 protected: |
| 31 views::View* CreateDefaultView() { | 28 views::View* CreateDefaultView() { |
| 32 TrayBrightness tray(NULL); | 29 TrayBrightness tray(NULL); |
| 33 return tray.CreateDefaultView(GetUserLoginStatus()); | 30 return tray.CreateDefaultView(GetUserLoginStatus()); |
| 34 } | 31 } |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 // Tests that the enabling of MaximizeMode has no affect on the visibility of a | 85 // Tests that the enabling of MaximizeMode has no affect on the visibility of a |
| 89 // previously created BrightnessView that belongs to a detailed view. | 86 // previously created BrightnessView that belongs to a detailed view. |
| 90 TEST_F(TrayBrightnessTest, DetailedViewVisibilityChangesDuringMaximizeMode) { | 87 TEST_F(TrayBrightnessTest, DetailedViewVisibilityChangesDuringMaximizeMode) { |
| 91 scoped_ptr<views::View> tray(CreateDetailedView()); | 88 scoped_ptr<views::View> tray(CreateDetailedView()); |
| 92 Shell::GetInstance()->EnableMaximizeModeWindowManager(true); | 89 Shell::GetInstance()->EnableMaximizeModeWindowManager(true); |
| 93 EXPECT_TRUE(tray->visible()); | 90 EXPECT_TRUE(tray->visible()); |
| 94 Shell::GetInstance()->EnableMaximizeModeWindowManager(false); | 91 Shell::GetInstance()->EnableMaximizeModeWindowManager(false); |
| 95 EXPECT_TRUE(tray->visible()); | 92 EXPECT_TRUE(tray->visible()); |
| 96 } | 93 } |
| 97 | 94 |
| 98 } // namespace internal | |
| 99 | |
| 100 } // namespace ash | 95 } // namespace ash |
| 101 | 96 |
| OLD | NEW |