| 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 "base/memory/scoped_vector.h" | 7 #include "base/memory/scoped_vector.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 #include "ui/display/chromeos/test/action_logger_util.h" | 10 #include "ui/display/chromeos/test/action_logger_util.h" |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 bool SoftwareMirroringEnabled() const override { | 105 bool SoftwareMirroringEnabled() const override { |
| 106 return software_mirroring_enabled_; | 106 return software_mirroring_enabled_; |
| 107 } | 107 } |
| 108 | 108 |
| 109 private: | 109 private: |
| 110 bool software_mirroring_enabled_; | 110 bool software_mirroring_enabled_; |
| 111 | 111 |
| 112 DISALLOW_COPY_AND_ASSIGN(TestMirroringController); | 112 DISALLOW_COPY_AND_ASSIGN(TestMirroringController); |
| 113 }; | 113 }; |
| 114 | 114 |
| 115 } // namespace |
| 116 |
| 115 class DisplayConfiguratorTest : public testing::Test { | 117 class DisplayConfiguratorTest : public testing::Test { |
| 116 public: | 118 public: |
| 117 enum CallbackResult { | 119 enum CallbackResult { |
| 118 CALLBACK_FAILURE, | 120 CALLBACK_FAILURE, |
| 119 CALLBACK_SUCCESS, | 121 CALLBACK_SUCCESS, |
| 120 CALLBACK_NOT_CALLED, | 122 CALLBACK_NOT_CALLED, |
| 121 }; | 123 }; |
| 122 | 124 |
| 123 DisplayConfiguratorTest() | 125 DisplayConfiguratorTest() |
| 124 : small_mode_(gfx::Size(1366, 768), false, 60.0f), | 126 : small_mode_(gfx::Size(1366, 768), false, 60.0f), |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 DisplayConfigurator::TestApi test_api_; | 222 DisplayConfigurator::TestApi test_api_; |
| 221 | 223 |
| 222 TestDisplaySnapshot outputs_[2]; | 224 TestDisplaySnapshot outputs_[2]; |
| 223 | 225 |
| 224 CallbackResult callback_result_; | 226 CallbackResult callback_result_; |
| 225 | 227 |
| 226 private: | 228 private: |
| 227 DISALLOW_COPY_AND_ASSIGN(DisplayConfiguratorTest); | 229 DISALLOW_COPY_AND_ASSIGN(DisplayConfiguratorTest); |
| 228 }; | 230 }; |
| 229 | 231 |
| 230 } // namespace | |
| 231 | |
| 232 TEST_F(DisplayConfiguratorTest, FindDisplayModeMatchingSize) { | 232 TEST_F(DisplayConfiguratorTest, FindDisplayModeMatchingSize) { |
| 233 ScopedVector<const DisplayMode> modes; | 233 ScopedVector<const DisplayMode> modes; |
| 234 | 234 |
| 235 // Fields are width, height, interlaced, refresh rate. | 235 // Fields are width, height, interlaced, refresh rate. |
| 236 modes.push_back(new DisplayMode(gfx::Size(1920, 1200), false, 60.0)); | 236 modes.push_back(new DisplayMode(gfx::Size(1920, 1200), false, 60.0)); |
| 237 DisplayMode* native_mode = | 237 DisplayMode* native_mode = |
| 238 new DisplayMode(gfx::Size(1920, 1200), false, 50.0); | 238 new DisplayMode(gfx::Size(1920, 1200), false, 50.0); |
| 239 modes.push_back(native_mode); | 239 modes.push_back(native_mode); |
| 240 // Different rates. | 240 // Different rates. |
| 241 modes.push_back(new DisplayMode(gfx::Size(1920, 1080), false, 30.0)); | 241 modes.push_back(new DisplayMode(gfx::Size(1920, 1080), false, 30.0)); |
| (...skipping 1106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1348 GetFramebufferAction(small_mode_.size(), &outputs_[0], | 1348 GetFramebufferAction(small_mode_.size(), &outputs_[0], |
| 1349 nullptr).c_str(), | 1349 nullptr).c_str(), |
| 1350 GetCrtcAction(outputs_[0], &small_mode_, | 1350 GetCrtcAction(outputs_[0], &small_mode_, |
| 1351 gfx::Point(0, 0)).c_str(), | 1351 gfx::Point(0, 0)).c_str(), |
| 1352 kUngrab, NULL), | 1352 kUngrab, NULL), |
| 1353 log_->GetActionsAndClear()); | 1353 log_->GetActionsAndClear()); |
| 1354 } | 1354 } |
| 1355 | 1355 |
| 1356 } // namespace test | 1356 } // namespace test |
| 1357 } // namespace ui | 1357 } // namespace ui |
| OLD | NEW |