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

Side by Side Diff: ash/system/chromeos/power/tablet_power_button_controller_unittest.cc

Issue 2741273002: chromeos: Promotes more from WmShell to Shell (Closed)
Patch Set: feedback Created 3 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/power/tablet_power_button_controller.h" 5 #include "ash/system/chromeos/power/tablet_power_button_controller.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "ash/common/ash_switches.h" 9 #include "ash/common/ash_switches.h"
10 #include "ash/common/session/session_state_delegate.h" 10 #include "ash/common/session/session_state_delegate.h"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 ->power_button_controller() 60 ->power_button_controller()
61 ->tablet_power_button_controller_for_test(); 61 ->tablet_power_button_controller_for_test();
62 test_api_ = base::MakeUnique<TabletPowerButtonController::TestApi>( 62 test_api_ = base::MakeUnique<TabletPowerButtonController::TestApi>(
63 tablet_controller_); 63 tablet_controller_);
64 lock_state_test_api_ = 64 lock_state_test_api_ =
65 base::MakeUnique<LockStateControllerTestApi>(lock_state_controller_); 65 base::MakeUnique<LockStateControllerTestApi>(lock_state_controller_);
66 tick_clock_ = new base::SimpleTestTickClock; 66 tick_clock_ = new base::SimpleTestTickClock;
67 tablet_controller_->SetTickClockForTesting( 67 tablet_controller_->SetTickClockForTesting(
68 std::unique_ptr<base::TickClock>(tick_clock_)); 68 std::unique_ptr<base::TickClock>(tick_clock_));
69 shell_delegate_ = 69 shell_delegate_ =
70 static_cast<TestShellDelegate*>(WmShell::Get()->delegate()); 70 static_cast<TestShellDelegate*>(Shell::Get()->shell_delegate());
71 generator_ = &AshTestBase::GetEventGenerator(); 71 generator_ = &AshTestBase::GetEventGenerator();
72 power_manager_client_->SendBrightnessChanged(kNonZeroBrightness, false); 72 power_manager_client_->SendBrightnessChanged(kNonZeroBrightness, false);
73 EXPECT_FALSE(GetBacklightsForcedOff()); 73 EXPECT_FALSE(GetBacklightsForcedOff());
74 } 74 }
75 75
76 void TearDown() override { 76 void TearDown() override {
77 generator_ = nullptr; 77 generator_ = nullptr;
78 const bool is_mash = WmShell::Get()->IsRunningInMash(); 78 const bool is_mash = WmShell::Get()->IsRunningInMash();
79 AshTestBase::TearDown(); 79 AshTestBase::TearDown();
80 // Mash shuts down dbus after each test. 80 // Mash shuts down dbus after each test.
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after
472 // Test that after another long duration, backlights should be forced off. 472 // Test that after another long duration, backlights should be forced off.
473 tick_clock_->Advance(base::TimeDelta::FromMilliseconds(800)); 473 tick_clock_->Advance(base::TimeDelta::FromMilliseconds(800));
474 power_manager_client_->SendPowerButtonEvent(true, tick_clock_->NowTicks()); 474 power_manager_client_->SendPowerButtonEvent(true, tick_clock_->NowTicks());
475 power_manager_client_->SendPowerButtonEvent(false, tick_clock_->NowTicks()); 475 power_manager_client_->SendPowerButtonEvent(false, tick_clock_->NowTicks());
476 power_manager_client_->SendBrightnessChanged(0, false); 476 power_manager_client_->SendBrightnessChanged(0, false);
477 EXPECT_TRUE(GetBacklightsForcedOff()); 477 EXPECT_TRUE(GetBacklightsForcedOff());
478 } 478 }
479 479
480 } // namespace test 480 } // namespace test
481 } // namespace ash 481 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/chromeos/power/tablet_power_button_controller.cc ('k') | ash/wm/lock_state_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698