Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / ui / display / chromeos / test / action_logger_util.h
blob35609de5db355a271b4099b1470e83d6cb96a6fc
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_
8 #include <string>
9 #include <vector>
11 #include "ui/display/types/display_constants.h"
13 namespace gfx {
14 class Point;
15 class Size;
16 } // namespace gfx
18 namespace ui {
20 struct GammaRampRGBEntry;
21 class DisplayMode;
22 class DisplaySnapshot;
24 namespace test {
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()
43 // call.
44 std::string GetBackgroundAction(uint32_t color_argb);
46 // Returns a string describing a TestNativeDisplayDelegate::AddOutputMode()
47 // call.
48 std::string GetAddOutputModeAction(const DisplaySnapshot& output,
49 const DisplayMode* mode);
51 // Returns a string describing a TestNativeDisplayDelegate::Configure()
52 // call.
53 std::string GetCrtcAction(const DisplaySnapshot& output,
54 const DisplayMode* mode,
55 const gfx::Point& origin);
57 // Returns a string describing a TestNativeDisplayDelegate::CreateFramebuffer()
58 // call.
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,
65 HDCPState state);
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, ...);
76 } // namespace test
77 } // namespace ui
79 #endif // UI_DISPLAY_CHROMEOS_TEST_ACTION_LOGGER_UTIL_H_