Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3439)

Unified Diff: ash/system/chromeos/brightness/tray_brightness_unittest.cc

Issue 2131733002: mash: Migrate [Keyboard]Brightness code to ash/common. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments. Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ash/system/chromeos/brightness/tray_brightness_unittest.cc
diff --git a/ash/system/chromeos/brightness/tray_brightness_unittest.cc b/ash/system/chromeos/brightness/tray_brightness_unittest.cc
deleted file mode 100644
index 6156e033ee3cc583de15923273cecac8cb04506d..0000000000000000000000000000000000000000
--- a/ash/system/chromeos/brightness/tray_brightness_unittest.cc
+++ /dev/null
@@ -1,102 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "ash/system/chromeos/brightness/tray_brightness.h"
-
-#include <memory>
-
-#include "ash/common/system/tray/system_tray_delegate.h"
-#include "ash/common/system/tray/system_tray_item.h"
-#include "ash/common/wm/maximize_mode/maximize_mode_controller.h"
-#include "ash/common/wm_shell.h"
-#include "ash/shell.h"
-#include "ash/test/ash_test_base.h"
-#include "ash/test/status_area_widget_test_helper.h"
-#include "ui/views/view.h"
-
-namespace ash {
-
-class TrayBrightnessTest : public test::AshTestBase {
- public:
- TrayBrightnessTest() {}
- ~TrayBrightnessTest() override {}
-
- protected:
- views::View* CreateDefaultView() {
- TrayBrightness tray(NULL);
- return tray.CreateDefaultView(
- StatusAreaWidgetTestHelper::GetUserLoginStatus());
- }
-
- views::View* CreateDetailedView() {
- TrayBrightness tray(NULL);
- return tray.CreateDetailedView(
- StatusAreaWidgetTestHelper::GetUserLoginStatus());
- }
-
- private:
- DISALLOW_COPY_AND_ASSIGN(TrayBrightnessTest);
-};
-
-// Tests that when the default view is initially created, that its
-// BrightnessView is created not visible.
-TEST_F(TrayBrightnessTest, CreateDefaultView) {
- std::unique_ptr<views::View> tray(CreateDefaultView());
- EXPECT_FALSE(tray->visible());
-}
-
-// Tests the construction of the default view while MaximizeMode is active.
-// The BrightnessView should be visible.
-TEST_F(TrayBrightnessTest, CreateDefaultViewDuringMaximizeMode) {
- WmShell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager(
- true);
- std::unique_ptr<views::View> tray(CreateDefaultView());
- EXPECT_TRUE(tray->visible());
- WmShell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager(
- false);
-}
-
-// Tests that the enabling of MaximizeMode affects a previously created
-// BrightnessView, changing the visibility.
-TEST_F(TrayBrightnessTest, DefaultViewVisibilityChangesDuringMaximizeMode) {
- std::unique_ptr<views::View> tray(CreateDefaultView());
- WmShell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager(
- true);
- EXPECT_TRUE(tray->visible());
- WmShell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager(
- false);
- EXPECT_FALSE(tray->visible());
-}
-
-// Tests that when the detailed view is initially created that its
-// BrightnessView is created as visible.
-TEST_F(TrayBrightnessTest, CreateDetailedView) {
- std::unique_ptr<views::View> tray(CreateDetailedView());
- EXPECT_TRUE(tray->visible());
-}
-
-// Tests that when the detailed view is created during MaximizeMode that its
-// BrightnessView is visible.
-TEST_F(TrayBrightnessTest, CreateDetailedViewDuringMaximizeMode) {
- WmShell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager(
- true);
- std::unique_ptr<views::View> tray(CreateDetailedView());
- EXPECT_TRUE(tray->visible());
- WmShell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager(
- false);
-}
-
-// Tests that the enabling of MaximizeMode has no affect on the visibility of a
-// previously created BrightnessView that belongs to a detailed view.
-TEST_F(TrayBrightnessTest, DetailedViewVisibilityChangesDuringMaximizeMode) {
- std::unique_ptr<views::View> tray(CreateDetailedView());
- WmShell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager(
- true);
- EXPECT_TRUE(tray->visible());
- WmShell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager(
- false);
- EXPECT_TRUE(tray->visible());
-}
-
-} // namespace ash
« no previous file with comments | « ash/system/chromeos/brightness/tray_brightness.cc ('k') | ash/system/chromeos/keyboard_brightness_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698