| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| 11 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
| 12 #include "ui/display/fake_display_snapshot.h" | 12 #include "ui/display/fake_display_snapshot.h" |
| 13 #include "ui/display/manager/chromeos/configure_displays_task.h" | 13 #include "ui/display/manager/chromeos/configure_displays_task.h" |
| 14 #include "ui/display/manager/chromeos/test/action_logger_util.h" | 14 #include "ui/display/manager/chromeos/test/action_logger_util.h" |
| 15 #include "ui/display/manager/chromeos/test/test_native_display_delegate.h" | 15 #include "ui/display/manager/chromeos/test/test_native_display_delegate.h" |
| 16 | 16 |
| 17 namespace ui { | 17 namespace display { |
| 18 namespace test { | 18 namespace test { |
| 19 | 19 |
| 20 namespace { | 20 namespace { |
| 21 | 21 |
| 22 class ConfigureDisplaysTaskTest : public testing::Test { | 22 class ConfigureDisplaysTaskTest : public testing::Test { |
| 23 public: | 23 public: |
| 24 ConfigureDisplaysTaskTest() | 24 ConfigureDisplaysTaskTest() |
| 25 : delegate_(&log_), | 25 : delegate_(&log_), |
| 26 callback_called_(false), | 26 callback_called_(false), |
| 27 status_(ConfigureDisplaysTask::ERROR), | 27 status_(ConfigureDisplaysTask::ERROR), |
| 28 small_mode_(gfx::Size(1366, 768), false, 60.0f), | 28 small_mode_(gfx::Size(1366, 768), false, 60.0f), |
| 29 big_mode_(gfx::Size(2560, 1600), false, 60.0f) { | 29 big_mode_(gfx::Size(2560, 1600), false, 60.0f) { |
| 30 displays_[0] = display::FakeDisplaySnapshot::Builder() | 30 displays_[0] = FakeDisplaySnapshot::Builder() |
| 31 .SetId(123) | 31 .SetId(123) |
| 32 .SetNativeMode(small_mode_.Clone()) | 32 .SetNativeMode(small_mode_.Clone()) |
| 33 .SetCurrentMode(small_mode_.Clone()) | 33 .SetCurrentMode(small_mode_.Clone()) |
| 34 .Build(); | 34 .Build(); |
| 35 | 35 |
| 36 displays_[1] = display::FakeDisplaySnapshot::Builder() | 36 displays_[1] = FakeDisplaySnapshot::Builder() |
| 37 .SetId(456) | 37 .SetId(456) |
| 38 .SetNativeMode(big_mode_.Clone()) | 38 .SetNativeMode(big_mode_.Clone()) |
| 39 .SetCurrentMode(big_mode_.Clone()) | 39 .SetCurrentMode(big_mode_.Clone()) |
| 40 .AddMode(small_mode_.Clone()) | 40 .AddMode(small_mode_.Clone()) |
| 41 .Build(); | 41 .Build(); |
| 42 } | 42 } |
| 43 ~ConfigureDisplaysTaskTest() override {} | 43 ~ConfigureDisplaysTaskTest() override {} |
| 44 | 44 |
| 45 void ConfigureCallback(ConfigureDisplaysTask::Status status) { | 45 void ConfigureCallback(ConfigureDisplaysTask::Status status) { |
| 46 callback_called_ = true; | 46 callback_called_ = true; |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 EXPECT_EQ( | 235 EXPECT_EQ( |
| 236 JoinActions( | 236 JoinActions( |
| 237 GetCrtcAction(*displays_[0], &small_mode_, gfx::Point()).c_str(), | 237 GetCrtcAction(*displays_[0], &small_mode_, gfx::Point()).c_str(), |
| 238 GetCrtcAction(*displays_[1], &big_mode_, gfx::Point()).c_str(), | 238 GetCrtcAction(*displays_[1], &big_mode_, gfx::Point()).c_str(), |
| 239 GetCrtcAction(*displays_[1], &small_mode_, gfx::Point()).c_str(), | 239 GetCrtcAction(*displays_[1], &small_mode_, gfx::Point()).c_str(), |
| 240 nullptr), | 240 nullptr), |
| 241 log_.GetActionsAndClear()); | 241 log_.GetActionsAndClear()); |
| 242 } | 242 } |
| 243 | 243 |
| 244 } // namespace test | 244 } // namespace test |
| 245 } // namespace ui | 245 } // namespace display |
| OLD | NEW |