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 <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <cmath> | 9 #include <cmath> |
10 #include <cstdarg> | 10 #include <cstdarg> |
11 #include <map> | 11 #include <map> |
12 #include <string> | 12 #include <string> |
13 #include <vector> | 13 #include <vector> |
14 | 14 |
15 #include "base/compiler_specific.h" | 15 #include "base/compiler_specific.h" |
16 #include "base/format_macros.h" | 16 #include "base/format_macros.h" |
17 #include "base/memory/scoped_vector.h" | 17 #include "base/memory/scoped_vector.h" |
18 #include "base/message_loop/message_loop.h" | 18 #include "base/message_loop/message_loop.h" |
19 #include "base/strings/stringprintf.h" | 19 #include "base/strings/stringprintf.h" |
20 #include "testing/gtest/include/gtest/gtest.h" | 20 #include "testing/gtest/include/gtest/gtest.h" |
21 #include "ui/display/chromeos/display_mode.h" | |
22 #include "ui/display/chromeos/native_display_delegate.h" | |
23 #include "ui/display/chromeos/test/test_display_snapshot.h" | 21 #include "ui/display/chromeos/test/test_display_snapshot.h" |
| 22 #include "ui/display/types/chromeos/display_mode.h" |
| 23 #include "ui/display/types/chromeos/native_display_delegate.h" |
24 | 24 |
25 namespace ui { | 25 namespace ui { |
26 | 26 |
27 namespace { | 27 namespace { |
28 | 28 |
29 // Strings returned by TestNativeDisplayDelegate::GetActionsAndClear() to | 29 // Strings returned by TestNativeDisplayDelegate::GetActionsAndClear() to |
30 // describe various actions that were performed. | 30 // describe various actions that were performed. |
31 const char kInitXRandR[] = "init"; | 31 const char kInitXRandR[] = "init"; |
32 const char kGrab[] = "grab"; | 32 const char kGrab[] = "grab"; |
33 const char kUngrab[] = "ungrab"; | 33 const char kUngrab[] = "ungrab"; |
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
392 : small_mode_(gfx::Size(1366, 768), false, 60.0f), | 392 : small_mode_(gfx::Size(1366, 768), false, 60.0f), |
393 big_mode_(gfx::Size(2560, 1600), false, 60.0f), | 393 big_mode_(gfx::Size(2560, 1600), false, 60.0f), |
394 observer_(&configurator_), | 394 observer_(&configurator_), |
395 test_api_(&configurator_) {} | 395 test_api_(&configurator_) {} |
396 virtual ~DisplayConfiguratorTest() {} | 396 virtual ~DisplayConfiguratorTest() {} |
397 | 397 |
398 virtual void SetUp() OVERRIDE { | 398 virtual void SetUp() OVERRIDE { |
399 log_.reset(new ActionLogger()); | 399 log_.reset(new ActionLogger()); |
400 | 400 |
401 native_display_delegate_ = new TestNativeDisplayDelegate(log_.get()); | 401 native_display_delegate_ = new TestNativeDisplayDelegate(log_.get()); |
402 configurator_.SetNativeDisplayDelegateForTesting( | |
403 scoped_ptr<NativeDisplayDelegate>(native_display_delegate_)); | |
404 | |
405 touchscreen_delegate_ = new TestTouchscreenDelegate(log_.get()); | 402 touchscreen_delegate_ = new TestTouchscreenDelegate(log_.get()); |
406 configurator_.SetTouchscreenDelegateForTesting( | 403 configurator_.SetDelegatesForTesting( |
| 404 scoped_ptr<NativeDisplayDelegate>(native_display_delegate_), |
407 scoped_ptr<DisplayConfigurator::TouchscreenDelegate>( | 405 scoped_ptr<DisplayConfigurator::TouchscreenDelegate>( |
408 touchscreen_delegate_)); | 406 touchscreen_delegate_)); |
409 | 407 |
410 configurator_.set_state_controller(&state_controller_); | 408 configurator_.set_state_controller(&state_controller_); |
411 configurator_.set_mirroring_controller(&mirroring_controller_); | 409 configurator_.set_mirroring_controller(&mirroring_controller_); |
412 | 410 |
413 std::vector<const DisplayMode*> modes; | 411 std::vector<const DisplayMode*> modes; |
414 modes.push_back(&small_mode_); | 412 modes.push_back(&small_mode_); |
415 | 413 |
416 TestDisplaySnapshot* o = &outputs_[0]; | 414 TestDisplaySnapshot* o = &outputs_[0]; |
(...skipping 944 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1361 gfx::Point(0, | 1359 gfx::Point(0, |
1362 modes[0]->size().height() + | 1360 modes[0]->size().height() + |
1363 DisplayConfigurator::kVerticalGap)) | 1361 DisplayConfigurator::kVerticalGap)) |
1364 .c_str(), | 1362 .c_str(), |
1365 kUngrab, | 1363 kUngrab, |
1366 NULL), | 1364 NULL), |
1367 log_->GetActionsAndClear()); | 1365 log_->GetActionsAndClear()); |
1368 } | 1366 } |
1369 | 1367 |
1370 } // namespace ui | 1368 } // namespace ui |
OLD | NEW |