OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "ui/display/chromeos/display_configurator.h" | 5 #include "ui/display/chromeos/display_configurator.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 833 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
844 EXPECT_EQ( | 844 EXPECT_EQ( |
845 JoinActions( | 845 JoinActions( |
846 kGrab, | 846 kGrab, |
847 GetFramebufferAction(small_mode_.size(), &outputs_[0], NULL).c_str(), | 847 GetFramebufferAction(small_mode_.size(), &outputs_[0], NULL).c_str(), |
848 GetCrtcAction(outputs_[0], NULL, gfx::Point(0, 0)).c_str(), | 848 GetCrtcAction(outputs_[0], NULL, gfx::Point(0, 0)).c_str(), |
849 kUngrab, | 849 kUngrab, |
850 kSync, | 850 kSync, |
851 NULL), | 851 NULL), |
852 log_->GetActionsAndClear()); | 852 log_->GetActionsAndClear()); |
853 configurator_.ResumeDisplays(); | 853 configurator_.ResumeDisplays(); |
| 854 |
| 855 // Expect the GetFramebuffer and GetCrtc actions to happen twice since we |
| 856 // configure the cached displays on resume to speed things up. |
854 EXPECT_EQ( | 857 EXPECT_EQ( |
855 JoinActions( | 858 JoinActions( |
856 kGrab, | 859 kGrab, |
857 GetFramebufferAction(small_mode_.size(), &outputs_[0], NULL).c_str(), | 860 GetFramebufferAction(small_mode_.size(), &outputs_[0], NULL).c_str(), |
858 GetCrtcAction(outputs_[0], &small_mode_, gfx::Point(0, 0)).c_str(), | 861 GetCrtcAction(outputs_[0], &small_mode_, gfx::Point(0, 0)).c_str(), |
| 862 GetFramebufferAction(small_mode_.size(), &outputs_[0], NULL).c_str(), |
| 863 GetCrtcAction(outputs_[0], &small_mode_, gfx::Point(0, 0)).c_str(), |
859 kForceDPMS, | 864 kForceDPMS, |
860 kUngrab, | 865 kUngrab, |
861 NULL), | 866 NULL), |
862 log_->GetActionsAndClear()); | 867 log_->GetActionsAndClear()); |
863 | 868 |
864 // Now turn the display off before suspending and check that the | 869 // Now turn the display off before suspending and check that the |
865 // configurator turns it back on and syncs with the server. | 870 // configurator turns it back on and syncs with the server. |
866 configurator_.SetDisplayPower( | 871 configurator_.SetDisplayPower( |
867 chromeos::DISPLAY_POWER_ALL_OFF, | 872 chromeos::DISPLAY_POWER_ALL_OFF, |
868 DisplayConfigurator::kSetDisplayPowerNoFlags, | 873 DisplayConfigurator::kSetDisplayPowerNoFlags, |
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1288 GetCrtcAction(outputs_[0], NULL, gfx::Point(0, 0)).c_str(), | 1293 GetCrtcAction(outputs_[0], NULL, gfx::Point(0, 0)).c_str(), |
1289 kUngrab, | 1294 kUngrab, |
1290 kSync, | 1295 kSync, |
1291 NULL), | 1296 NULL), |
1292 log_->GetActionsAndClear()); | 1297 log_->GetActionsAndClear()); |
1293 | 1298 |
1294 EXPECT_FALSE(test_api_.TriggerConfigureTimeout()); | 1299 EXPECT_FALSE(test_api_.TriggerConfigureTimeout()); |
1295 EXPECT_EQ(kNoActions, log_->GetActionsAndClear()); | 1300 EXPECT_EQ(kNoActions, log_->GetActionsAndClear()); |
1296 | 1301 |
1297 configurator_.ResumeDisplays(); | 1302 configurator_.ResumeDisplays(); |
| 1303 |
| 1304 // Expect the GetFramebuffer and GetCrtc actions to happen twice since we |
| 1305 // configure the cached displays on resume to speed things up. |
1298 EXPECT_EQ( | 1306 EXPECT_EQ( |
1299 JoinActions( | 1307 JoinActions( |
1300 kGrab, | 1308 kGrab, |
1301 GetFramebufferAction(small_mode_.size(), &outputs_[0], NULL).c_str(), | 1309 GetFramebufferAction(small_mode_.size(), &outputs_[0], NULL).c_str(), |
1302 GetCrtcAction(outputs_[0], &small_mode_, gfx::Point(0, 0)).c_str(), | 1310 GetCrtcAction(outputs_[0], &small_mode_, gfx::Point(0, 0)).c_str(), |
| 1311 GetFramebufferAction(small_mode_.size(), &outputs_[0], NULL).c_str(), |
| 1312 GetCrtcAction(outputs_[0], &small_mode_, gfx::Point(0, 0)).c_str(), |
1303 kForceDPMS, | 1313 kForceDPMS, |
1304 kUngrab, | 1314 kUngrab, |
1305 NULL), | 1315 NULL), |
1306 log_->GetActionsAndClear()); | 1316 log_->GetActionsAndClear()); |
1307 } | 1317 } |
1308 | 1318 |
1309 TEST_F(DisplayConfiguratorTest, ContentProtectionTwoClients) { | 1319 TEST_F(DisplayConfiguratorTest, ContentProtectionTwoClients) { |
1310 DisplayConfigurator::ContentProtectionClientId client1 = | 1320 DisplayConfigurator::ContentProtectionClientId client1 = |
1311 configurator_.RegisterContentProtectionClient(); | 1321 configurator_.RegisterContentProtectionClient(); |
1312 DisplayConfigurator::ContentProtectionClientId client2 = | 1322 DisplayConfigurator::ContentProtectionClientId client2 = |
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1639 GetFramebufferAction(small_mode_.size(), &outputs_[0], | 1649 GetFramebufferAction(small_mode_.size(), &outputs_[0], |
1640 nullptr).c_str(), | 1650 nullptr).c_str(), |
1641 GetCrtcAction(outputs_[0], &small_mode_, | 1651 GetCrtcAction(outputs_[0], &small_mode_, |
1642 gfx::Point(0, 0)).c_str(), | 1652 gfx::Point(0, 0)).c_str(), |
1643 kUngrab, NULL), | 1653 kUngrab, NULL), |
1644 log_->GetActionsAndClear()); | 1654 log_->GetActionsAndClear()); |
1645 } | 1655 } |
1646 | 1656 |
1647 } // namespace test | 1657 } // namespace test |
1648 } // namespace ui | 1658 } // namespace ui |
OLD | NEW |