| 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/manager/chromeos/update_display_configuration_task.h" | 5 #include "ui/display/manager/chromeos/update_display_configuration_task.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| 11 #include "base/bind.h" | 11 #include "base/bind.h" |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/memory/ptr_util.h" | 13 #include "base/memory/ptr_util.h" |
| 14 #include "base/message_loop/message_loop.h" | 14 #include "base/message_loop/message_loop.h" |
| 15 #include "base/run_loop.h" | 15 #include "base/run_loop.h" |
| 16 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
| 17 #include "ui/display/fake_display_snapshot.h" | 17 #include "ui/display/fake_display_snapshot.h" |
| 18 #include "ui/display/manager/chromeos/display_layout_manager.h" | 18 #include "ui/display/manager/chromeos/display_layout_manager.h" |
| 19 #include "ui/display/manager/chromeos/test/action_logger_util.h" | 19 #include "ui/display/manager/chromeos/test/action_logger_util.h" |
| 20 #include "ui/display/manager/chromeos/test/test_native_display_delegate.h" | 20 #include "ui/display/manager/chromeos/test/test_native_display_delegate.h" |
| 21 | 21 |
| 22 namespace ui { | 22 namespace display { |
| 23 namespace test { | 23 namespace test { |
| 24 | 24 |
| 25 namespace { | 25 namespace { |
| 26 | 26 |
| 27 class TestSoftwareMirroringController | 27 class TestSoftwareMirroringController |
| 28 : public DisplayConfigurator::SoftwareMirroringController { | 28 : public DisplayConfigurator::SoftwareMirroringController { |
| 29 public: | 29 public: |
| 30 TestSoftwareMirroringController() : is_enabled_(false) {} | 30 TestSoftwareMirroringController() : is_enabled_(false) {} |
| 31 ~TestSoftwareMirroringController() override {} | 31 ~TestSoftwareMirroringController() override {} |
| 32 | 32 |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 class UpdateDisplayConfigurationTaskTest : public testing::Test { | 147 class UpdateDisplayConfigurationTaskTest : public testing::Test { |
| 148 public: | 148 public: |
| 149 UpdateDisplayConfigurationTaskTest() | 149 UpdateDisplayConfigurationTaskTest() |
| 150 : delegate_(&log_), | 150 : delegate_(&log_), |
| 151 small_mode_(gfx::Size(1366, 768), false, 60.0f), | 151 small_mode_(gfx::Size(1366, 768), false, 60.0f), |
| 152 big_mode_(gfx::Size(2560, 1600), false, 60.0f), | 152 big_mode_(gfx::Size(2560, 1600), false, 60.0f), |
| 153 configured_(false), | 153 configured_(false), |
| 154 configuration_status_(false), | 154 configuration_status_(false), |
| 155 display_state_(MULTIPLE_DISPLAY_STATE_INVALID), | 155 display_state_(MULTIPLE_DISPLAY_STATE_INVALID), |
| 156 power_state_(chromeos::DISPLAY_POWER_ALL_ON) { | 156 power_state_(chromeos::DISPLAY_POWER_ALL_ON) { |
| 157 displays_[0] = display::FakeDisplaySnapshot::Builder() | 157 displays_[0] = FakeDisplaySnapshot::Builder() |
| 158 .SetId(123) | 158 .SetId(123) |
| 159 .SetNativeMode(small_mode_.Clone()) | 159 .SetNativeMode(small_mode_.Clone()) |
| 160 .SetCurrentMode(small_mode_.Clone()) | 160 .SetCurrentMode(small_mode_.Clone()) |
| 161 .Build(); | 161 .Build(); |
| 162 | 162 |
| 163 displays_[1] = display::FakeDisplaySnapshot::Builder() | 163 displays_[1] = FakeDisplaySnapshot::Builder() |
| 164 .SetId(456) | 164 .SetId(456) |
| 165 .SetNativeMode(big_mode_.Clone()) | 165 .SetNativeMode(big_mode_.Clone()) |
| 166 .SetCurrentMode(big_mode_.Clone()) | 166 .SetCurrentMode(big_mode_.Clone()) |
| 167 .AddMode(small_mode_.Clone()) | 167 .AddMode(small_mode_.Clone()) |
| 168 .Build(); | 168 .Build(); |
| 169 } | 169 } |
| 170 ~UpdateDisplayConfigurationTaskTest() override {} | 170 ~UpdateDisplayConfigurationTaskTest() override {} |
| 171 | 171 |
| 172 void UpdateDisplays(size_t count) { | 172 void UpdateDisplays(size_t count) { |
| 173 std::vector<DisplaySnapshot*> displays; | 173 std::vector<DisplaySnapshot*> displays; |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 488 .c_str(), | 488 .c_str(), |
| 489 GetCrtcAction(*displays_[0], &small_mode_, gfx::Point()).c_str(), | 489 GetCrtcAction(*displays_[0], &small_mode_, gfx::Point()).c_str(), |
| 490 GetCrtcAction(*displays_[1], &big_mode_, | 490 GetCrtcAction(*displays_[1], &big_mode_, |
| 491 gfx::Point(0, small_mode_.size().height())) | 491 gfx::Point(0, small_mode_.size().height())) |
| 492 .c_str(), | 492 .c_str(), |
| 493 kUngrab, nullptr), | 493 kUngrab, nullptr), |
| 494 log_.GetActionsAndClear()); | 494 log_.GetActionsAndClear()); |
| 495 } | 495 } |
| 496 | 496 |
| 497 } // namespace test | 497 } // namespace test |
| 498 } // namespace ui | 498 } // namespace display |
| OLD | NEW |