| Index: ui/display/chromeos/display_configurator_unittest.cc
|
| diff --git a/ui/display/chromeos/display_configurator_unittest.cc b/ui/display/chromeos/display_configurator_unittest.cc
|
| index dd99ab5e0fec68e6acb9fbbf9518281b9c282530..700fd28816b00be7c90c62ddacf5187a5d603934 100644
|
| --- a/ui/display/chromeos/display_configurator_unittest.cc
|
| +++ b/ui/display/chromeos/display_configurator_unittest.cc
|
| @@ -305,6 +305,56 @@ TEST_F(DisplayConfiguratorTest, FindDisplayModeMatchingSize) {
|
| output, gfx::Size(1440, 900)));
|
| }
|
|
|
| +TEST_F(DisplayConfiguratorTest, EnableVirtualDisplay) {
|
| + InitWithSingleOutput();
|
| +
|
| + observer_.Reset();
|
| + const DisplayConfigurator::DisplayStateList* cached =
|
| + &configurator_.cached_displays();
|
| + ASSERT_EQ(static_cast<size_t>(1), cached->size());
|
| + EXPECT_EQ(small_mode_.size(), (*cached)[0].display->current_mode()->size());
|
| +
|
| + // Add virtual display.
|
| + configurator_.EnableVirtualDisplay(big_mode_.size());
|
| + EXPECT_FALSE(mirroring_controller_.SoftwareMirroringEnabled());
|
| + EXPECT_EQ(MULTIPLE_DISPLAY_STATE_DUAL_EXTENDED,
|
| + configurator_.display_state());
|
| +
|
| + // Virtual should not trigger addition of added crtc but does change FB
|
| + // height.
|
| + const int kDualHeight = small_mode_.size().height() +
|
| + DisplayConfigurator::kVerticalGap +
|
| + big_mode_.size().height();
|
| + EXPECT_EQ(
|
| + JoinActions(
|
| + kGrab,
|
| + GetFramebufferAction(gfx::Size(big_mode_.size().width(), kDualHeight),
|
| + &outputs_[0], NULL).c_str(),
|
| + GetCrtcAction(outputs_[0], &small_mode_, gfx::Point(0, 0)).c_str(),
|
| + kUngrab, NULL),
|
| + log_->GetActionsAndClear());
|
| + EXPECT_EQ(1, observer_.num_changes());
|
| + cached = &configurator_.cached_displays();
|
| + ASSERT_EQ(static_cast<size_t>(2), cached->size());
|
| + EXPECT_EQ(small_mode_.size(), (*cached)[0].display->current_mode()->size());
|
| + EXPECT_EQ(big_mode_.size(), (*cached)[1].display->current_mode()->size());
|
| +
|
| + // Remove virtual display.
|
| + observer_.Reset();
|
| + configurator_.DisableVirtualDisplay();
|
| + EXPECT_EQ(JoinActions(kGrab, GetFramebufferAction(small_mode_.size(),
|
| + &outputs_[0], NULL).c_str(),
|
| + GetCrtcAction(outputs_[0], &small_mode_,
|
| + gfx::Point(0, 0)).c_str(),
|
| + kUngrab, NULL),
|
| + log_->GetActionsAndClear());
|
| + EXPECT_EQ(1, observer_.num_changes());
|
| + cached = &configurator_.cached_displays();
|
| + ASSERT_EQ(static_cast<size_t>(1), cached->size());
|
| + EXPECT_EQ(small_mode_.size(), (*cached)[0].display->current_mode()->size());
|
| + EXPECT_EQ(MULTIPLE_DISPLAY_STATE_SINGLE, configurator_.display_state());
|
| +}
|
| +
|
| TEST_F(DisplayConfiguratorTest, ConnectSecondOutput) {
|
| InitWithSingleOutput();
|
|
|
|
|