Chromium Code Reviews| Index: chromeos/display/output_configurator_unittest.cc |
| diff --git a/chromeos/display/output_configurator_unittest.cc b/chromeos/display/output_configurator_unittest.cc |
| index c253270ac49f5e942b9615b6b7881ce0eeedd53d..c091756b75dafd4505f1779a144d14ea8240721e 100644 |
| --- a/chromeos/display/output_configurator_unittest.cc |
| +++ b/chromeos/display/output_configurator_unittest.cc |
| @@ -787,6 +787,40 @@ TEST_F(OutputConfiguratorTest, SetDisplayPower) { |
| EXPECT_EQ(1, observer_.num_changes()); |
| } |
| +TEST_F(OutputConfiguratorTest, Casting) { |
| + InitWithSingleOutput(); |
| + |
| + // Notify configurator that casting session is started. |
| + configurator_.OnCastingStateChanged(true); |
| + EXPECT_EQ(JoinActions(kProjectingOn, NULL), delegate_->GetActionsAndClear()); |
|
Daniel Erat
2014/01/17 19:13:51
nit: after this code, maybe add:
configurator_.
hshi1
2014/01/17 19:31:28
Done.
|
| + |
| + // Turn all displays off and check that projecting is not turned off. |
| + configurator_.SetDisplayPower(DISPLAY_POWER_ALL_OFF, |
| + OutputConfigurator::kSetDisplayPowerNoFlags); |
| + EXPECT_EQ(JoinActions(kGrab, |
| + GetFramebufferAction(kSmallModeWidth, kSmallModeHeight, |
| + outputs_[0].crtc, 0).c_str(), |
| + GetCrtcAction(outputs_[0].crtc, 0, 0, 0, |
| + outputs_[0].output).c_str(), |
| + kUngrab, NULL), |
| + delegate_->GetActionsAndClear()); |
| + |
| + // Turn all displays back on. |
| + configurator_.SetDisplayPower(DISPLAY_POWER_ALL_ON, |
| + OutputConfigurator::kSetDisplayPowerNoFlags); |
| + EXPECT_EQ(JoinActions(kGrab, |
| + GetFramebufferAction(kSmallModeWidth, kSmallModeHeight, |
| + outputs_[0].crtc, 0).c_str(), |
| + GetCrtcAction(outputs_[0].crtc, 0, 0, kSmallModeId, |
| + outputs_[0].output).c_str(), |
| + kForceDPMS, kUngrab, NULL), |
| + delegate_->GetActionsAndClear()); |
| + |
| + // Notify configurator that casting session is ended. |
| + configurator_.OnCastingStateChanged(false); |
| + EXPECT_EQ(JoinActions(kProjectingOff, NULL), delegate_->GetActionsAndClear()); |
| +} |
| + |
| TEST_F(OutputConfiguratorTest, SuspendAndResume) { |
| InitWithSingleOutput(); |