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

Unified Diff: ash/accelerators/accelerator_controller_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
« no previous file with comments | « ash/accelerators/accelerator_controller.cc ('k') | ash/ash.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/accelerators/accelerator_controller_unittest.cc
diff --git a/ash/accelerators/accelerator_controller_unittest.cc b/ash/accelerators/accelerator_controller_unittest.cc
index e9e518796db0529806450049593a8bea38130de8..88bd52a54a4553d259c5dd9430c2c9d3d52a8684 100644
--- a/ash/accelerators/accelerator_controller_unittest.cc
+++ b/ash/accelerators/accelerator_controller_unittest.cc
@@ -8,8 +8,10 @@
#include "ash/aura/wm_window_aura.h"
#include "ash/common/accessibility_delegate.h"
#include "ash/common/accessibility_types.h"
-#include "ash/common/ash_switches.h"
+#include "ash/common/session/session_state_delegate.h"
#include "ash/common/shell_window_ids.h"
+#include "ash/common/system/brightness_control_delegate.h"
+#include "ash/common/system/keyboard_brightness_control_delegate.h"
#include "ash/common/system/tray/system_tray_delegate.h"
#include "ash/common/system/volume_control_delegate.h"
#include "ash/common/wm/panels/panel_layout_manager.h"
@@ -19,21 +21,16 @@
#include "ash/common/wm_shell.h"
#include "ash/display/display_manager.h"
#include "ash/ime_control_delegate.h"
-#include "ash/screen_util.h"
#include "ash/shell.h"
-#include "ash/system/brightness_control_delegate.h"
-#include "ash/system/keyboard_brightness/keyboard_brightness_control_delegate.h"
#include "ash/test/ash_test_base.h"
#include "ash/test/display_manager_test_api.h"
#include "ash/test/test_screenshot_delegate.h"
#include "ash/test/test_session_state_animator.h"
#include "ash/test/test_shelf_delegate.h"
-#include "ash/test/test_shell_delegate.h"
#include "ash/test/test_volume_control_delegate.h"
#include "ash/wm/lock_state_controller.h"
#include "ash/wm/window_state_aura.h"
#include "ash/wm/window_util.h"
-#include "base/command_line.h"
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/test/test_window_delegate.h"
#include "ui/aura/test/test_windows.h"
@@ -266,6 +263,16 @@ class AcceleratorControllerTest : public test::AshTestBase {
return window;
}
+ void SetBrightnessControlDelegate(
+ std::unique_ptr<BrightnessControlDelegate> delegate) {
+ WmShell::Get()->brightness_control_delegate_ = std::move(delegate);
+ }
+
+ void SetKeyboardBrightnessControlDelegate(
+ std::unique_ptr<KeyboardBrightnessControlDelegate> delegate) {
+ WmShell::Get()->keyboard_brightness_control_delegate_ = std::move(delegate);
+ }
+
private:
DISALLOW_COPY_AND_ASSIGN(AcceleratorControllerTest);
};
@@ -859,7 +866,7 @@ TEST_F(AcceleratorControllerTest, GlobalAccelerators) {
{
DummyBrightnessControlDelegate* delegate =
new DummyBrightnessControlDelegate;
- GetController()->SetBrightnessControlDelegate(
+ SetBrightnessControlDelegate(
std::unique_ptr<BrightnessControlDelegate>(delegate));
EXPECT_EQ(0, delegate->handle_brightness_down_count());
EXPECT_TRUE(ProcessInController(brightness_down));
@@ -881,7 +888,7 @@ TEST_F(AcceleratorControllerTest, GlobalAccelerators) {
EXPECT_TRUE(ProcessInController(alt_brightness_up));
DummyKeyboardBrightnessControlDelegate* delegate =
new DummyKeyboardBrightnessControlDelegate;
- GetController()->SetKeyboardBrightnessControlDelegate(
+ SetKeyboardBrightnessControlDelegate(
std::unique_ptr<KeyboardBrightnessControlDelegate>(delegate));
EXPECT_EQ(0, delegate->handle_keyboard_brightness_down_count());
EXPECT_TRUE(ProcessInController(alt_brightness_down));
@@ -1237,7 +1244,7 @@ TEST_F(AcceleratorControllerTest, DisallowedAtModalWindow) {
{
DummyBrightnessControlDelegate* delegate =
new DummyBrightnessControlDelegate;
- GetController()->SetBrightnessControlDelegate(
+ SetBrightnessControlDelegate(
std::unique_ptr<BrightnessControlDelegate>(delegate));
EXPECT_EQ(0, delegate->handle_brightness_down_count());
EXPECT_TRUE(ProcessInController(brightness_down));
« no previous file with comments | « ash/accelerators/accelerator_controller.cc ('k') | ash/ash.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698