Chromium Code Reviews| 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/test/action_logger_util.h" | 5 #include "ui/display/chromeos/test/action_logger_util.h" |
| 6 | 6 |
| 7 #include "base/format_macros.h" | 7 #include "base/format_macros.h" |
| 8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
| 9 #include "ui/display/types/display_mode.h" | 9 #include "ui/display/types/display_mode.h" |
| 10 #include "ui/display/types/display_snapshot.h" | 10 #include "ui/display/types/display_snapshot.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 45 size.height(), out1 ? DisplaySnapshotToString(*out1).c_str() : "NULL", | 45 size.height(), out1 ? DisplaySnapshotToString(*out1).c_str() : "NULL", |
| 46 out2 ? DisplaySnapshotToString(*out2).c_str() : "NULL"); | 46 out2 ? DisplaySnapshotToString(*out2).c_str() : "NULL"); |
| 47 } | 47 } |
| 48 | 48 |
| 49 std::string GetSetHDCPStateAction(const DisplaySnapshot& output, | 49 std::string GetSetHDCPStateAction(const DisplaySnapshot& output, |
| 50 HDCPState state) { | 50 HDCPState state) { |
| 51 return base::StringPrintf("set_hdcp(id=%" PRId64 ",state=%d)", | 51 return base::StringPrintf("set_hdcp(id=%" PRId64 ",state=%d)", |
| 52 output.display_id(), state); | 52 output.display_id(), state); |
| 53 } | 53 } |
| 54 | 54 |
| 55 std::string SetGammaRampAction(const ui::DisplaySnapshot& output, | |
| 56 const std::vector<uint16_t>& r, | |
| 57 const std::vector<uint16_t>& g, | |
| 58 const std::vector<uint16_t>& b) { | |
|
oshima
2015/04/02 15:56:52
are you going to use r/g/b later?
| |
| 59 return base::StringPrintf("set_gamma_ramp(id=%" PRId64 ")", | |
| 60 output.display_id()); | |
| 61 } | |
| 62 | |
| 55 std::string JoinActions(const char* action, ...) { | 63 std::string JoinActions(const char* action, ...) { |
| 56 std::string actions; | 64 std::string actions; |
| 57 | 65 |
| 58 va_list arg_list; | 66 va_list arg_list; |
| 59 va_start(arg_list, action); | 67 va_start(arg_list, action); |
| 60 while (action) { | 68 while (action) { |
| 61 if (!actions.empty()) | 69 if (!actions.empty()) |
| 62 actions += ","; | 70 actions += ","; |
| 63 actions += action; | 71 actions += action; |
| 64 action = va_arg(arg_list, const char*); | 72 action = va_arg(arg_list, const char*); |
| 65 } | 73 } |
| 66 va_end(arg_list); | 74 va_end(arg_list); |
| 67 return actions; | 75 return actions; |
| 68 } | 76 } |
| 69 | 77 |
| 70 } // namespace test | 78 } // namespace test |
| 71 } // namespace ui | 79 } // namespace ui |
| OLD | NEW |