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_ACTION_LOGGER_UTIL_H_
6 #define UI_DISPLAY_CHROMEOS_TEST_ACTION_LOGGER_UTIL_H_
11 #include "ui/display/types/display_constants.h"
20 struct GammaRampRGBEntry
;
22 class DisplaySnapshot
;
26 // Strings returned by TestNativeDisplayDelegate::GetActionsAndClear() to
27 // describe various actions that were performed.
28 const char kInitXRandR
[] = "init";
29 const char kGrab
[] = "grab";
30 const char kUngrab
[] = "ungrab";
31 const char kSync
[] = "sync";
32 const char kForceDPMS
[] = "dpms";
33 const char kTakeDisplayControl
[] = "take";
34 const char kRelinquishDisplayControl
[] = "relinquish";
36 // String returned by TestNativeDisplayDelegate::GetActionsAndClear() if no
37 // actions were requested.
38 const char kNoActions
[] = "";
40 std::string
DisplaySnapshotToString(const DisplaySnapshot
& output
);
42 // Returns a string describing a TestNativeDisplayDelegate::SetBackgroundColor()
44 std::string
GetBackgroundAction(uint32_t color_argb
);
46 // Returns a string describing a TestNativeDisplayDelegate::AddOutputMode()
48 std::string
GetAddOutputModeAction(const DisplaySnapshot
& output
,
49 const DisplayMode
* mode
);
51 // Returns a string describing a TestNativeDisplayDelegate::Configure()
53 std::string
GetCrtcAction(const DisplaySnapshot
& output
,
54 const DisplayMode
* mode
,
55 const gfx::Point
& origin
);
57 // Returns a string describing a TestNativeDisplayDelegate::CreateFramebuffer()
59 std::string
GetFramebufferAction(const gfx::Size
& size
,
60 const DisplaySnapshot
* out1
,
61 const DisplaySnapshot
* out2
);
63 // Returns a string describing a TestNativeDisplayDelegate::SetHDCPState() call.
64 std::string
GetSetHDCPStateAction(const DisplaySnapshot
& output
,
67 // Returns a string describing a TestNativeDisplayDelegate::SetGammaRamp() call;
68 std::string
SetGammaRampAction(const ui::DisplaySnapshot
& output
,
69 const std::vector
<GammaRampRGBEntry
>& lut
);
70 // Joins a sequence of strings describing actions (e.g. kScreenDim) such
71 // that they can be compared against a string returned by
72 // ActionLogger::GetActionsAndClear(). The list of actions must be
73 // terminated by a NULL pointer.
74 std::string
JoinActions(const char* action
, ...);
79 #endif // UI_DISPLAY_CHROMEOS_TEST_ACTION_LOGGER_UTIL_H_