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

Unified Diff: chromeos/display/output_configurator_unittest.cc

Issue 139053003: Chrome OS: avoid suspending on lid close when casting is active. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove dependencies of chrome in ash. Created 6 years, 11 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: chromeos/display/output_configurator_unittest.cc
diff --git a/chromeos/display/output_configurator_unittest.cc b/chromeos/display/output_configurator_unittest.cc
index c253270ac49f5e942b9615b6b7881ce0eeedd53d..e359b373935016f8de0747b8844e8fdd79571cc2 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, ScreenSharing) {
+ InitWithSingleOutput();
+
+ // Notify configurator that screen sharing session is started.
+ configurator_.OnScreenSharingStateChanged(true);
+ EXPECT_EQ(JoinActions(kProjectingOn, NULL), delegate_->GetActionsAndClear());
+
+ // 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 screen sharing session is ended.
+ configurator_.OnScreenSharingStateChanged(false);
+ EXPECT_EQ(JoinActions(kProjectingOff, NULL), delegate_->GetActionsAndClear());
+}
+
TEST_F(OutputConfiguratorTest, SuspendAndResume) {
InitWithSingleOutput();
« chromeos/display/output_configurator.cc ('K') | « chromeos/display/output_configurator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698