Supervised user whitelists: Cleanup
[chromium-blink-merge.git] / ui / display / chromeos / test / test_native_display_delegate.h
blobf9e1767ff4f7bb13ac7c00777c4174b9e6fa243f
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
3 // found in the LICENSE file.
5 #ifndef UI_DISPLAY_CHROMEOS_TEST_TEST_NATIVE_DISPLAY_DELEGATE_H_
6 #define UI_DISPLAY_CHROMEOS_TEST_TEST_NATIVE_DISPLAY_DELEGATE_H_
8 #include <vector>
10 #include "base/macros.h"
11 #include "ui/display/chromeos/test/action_logger.h"
12 #include "ui/display/chromeos/test/action_logger_util.h"
13 #include "ui/display/types/native_display_delegate.h"
15 namespace ui {
17 class ActionLogger;
18 class DisplaySnapshot;
20 namespace test {
22 class TestNativeDisplayDelegate : public NativeDisplayDelegate {
23 public:
24 // Ownership of |log| remains with the caller.
25 explicit TestNativeDisplayDelegate(ActionLogger* log);
26 ~TestNativeDisplayDelegate() override;
28 const std::vector<DisplaySnapshot*>& outputs() const { return outputs_; }
30 void set_outputs(const std::vector<DisplaySnapshot*>& outputs) {
31 outputs_ = outputs;
34 void set_max_configurable_pixels(int pixels) {
35 max_configurable_pixels_ = pixels;
38 void set_get_hdcp_state_expectation(bool success) {
39 get_hdcp_expectation_ = success;
42 void set_set_hdcp_state_expectation(bool success) {
43 set_hdcp_expectation_ = success;
46 void set_hdcp_state(HDCPState state) { hdcp_state_ = state; }
48 void set_run_async(bool run_async) { run_async_ = run_async; }
50 // NativeDisplayDelegate overrides:
51 void Initialize() override;
52 void GrabServer() override;
53 void UngrabServer() override;
54 bool TakeDisplayControl() override;
55 bool RelinquishDisplayControl() override;
56 void SyncWithServer() override;
57 void SetBackgroundColor(uint32_t color_argb) override;
58 void ForceDPMSOn() override;
59 void GetDisplays(const GetDisplaysCallback& callback) override;
60 void AddMode(const DisplaySnapshot& output, const DisplayMode* mode) override;
61 void Configure(const DisplaySnapshot& output,
62 const DisplayMode* mode,
63 const gfx::Point& origin,
64 const ConfigureCallback& callback) override;
65 void CreateFrameBuffer(const gfx::Size& size) override;
66 void GetHDCPState(const DisplaySnapshot& output,
67 const GetHDCPStateCallback& callback) override;
68 void SetHDCPState(const DisplaySnapshot& output,
69 HDCPState state,
70 const SetHDCPStateCallback& callback) override;
71 std::vector<ui::ColorCalibrationProfile> GetAvailableColorCalibrationProfiles(
72 const DisplaySnapshot& output) override;
73 bool SetColorCalibrationProfile(
74 const DisplaySnapshot& output,
75 ui::ColorCalibrationProfile new_profile) override;
76 void AddObserver(NativeDisplayObserver* observer) override;
77 void RemoveObserver(NativeDisplayObserver* observer) override;
79 private:
80 bool Configure(const DisplaySnapshot& output,
81 const DisplayMode* mode,
82 const gfx::Point& origin);
84 // Outputs to be returned by GetDisplays().
85 std::vector<DisplaySnapshot*> outputs_;
87 // |max_configurable_pixels_| represents the maximum number of pixels that
88 // Configure will support. Tests can use this to force Configure
89 // to fail if attempting to set a resolution that is higher than what
90 // a device might support under a given circumstance.
91 // A value of 0 means that no limit is enforced and Configure will
92 // return success regardless of the resolution.
93 int max_configurable_pixels_;
95 bool get_hdcp_expectation_;
96 bool set_hdcp_expectation_;
98 // Result value of GetHDCPState().
99 HDCPState hdcp_state_;
101 // If true, the callbacks are posted on the message loop.
102 bool run_async_;
104 ActionLogger* log_; // Not owned.
106 DISALLOW_COPY_AND_ASSIGN(TestNativeDisplayDelegate);
109 } // namespace test
110 } // namespace ui
112 #endif // UI_DISPLAY_CHROMEOS_TEST_TEST_NATIVE_DISPLAY_DELEGATE_H_