3#include "absl/strings/ascii.h"
4#include "absl/strings/str_cat.h"
5#include "absl/strings/str_format.h"
6#include "absl/strings/str_replace.h"
13 return absl::StrFormat(
"%s:%d", host, port);
18 out.reserve(value.size() + 8);
19 for (
unsigned char c : value) {
44 absl::StrAppend(&out, absl::StrFormat(
"\\u%04X",
static_cast<int>(c)));
46 out.push_back(
static_cast<char>(c));
54 std::string escaped(value);
55 absl::StrReplaceAll({{
"\\",
"\\\\"}, {
"\"",
"\\\""}}, &escaped);
56 return absl::StrCat(
"\"", escaped,
"\"");
60 if (!time.has_value()) {
63 return absl::FormatTime(
"%Y-%m-%dT%H:%M:%SZ", *time, absl::UTCTimeZone());
67 if (!time.has_value()) {
70 return absl::FormatTime(
"%Y-%m-%dT%H:%M:%SZ", *time, absl::UTCTimeZone());
78 return absl::StrCat(
"\"",
JsonEscape(iso),
"\"");
122 std::string lower = std::string(absl::AsciiStrToLower(value));
133 std::string lower = std::string(absl::AsciiStrToLower(value));
134 if (lower.empty() || lower ==
"unspecified" || lower ==
"any") {
137 if (lower ==
"all") {
140 if (lower ==
"button" || lower ==
"buttons") {
143 if (lower ==
"input" || lower ==
"textbox" || lower ==
"field") {
146 if (lower ==
"menu" || lower ==
"menuitem" || lower ==
"menu-item") {
149 if (lower ==
"tab" || lower ==
"tabs") {
152 if (lower ==
"checkbox" || lower ==
"toggle") {
155 if (lower ==
"slider" || lower ==
"drag" || lower ==
"sliderfloat") {
158 if (lower ==
"canvas" || lower ==
"viewport") {
161 if (lower ==
"selectable" || lower ==
"list-item") {
164 if (lower ==
"other") {
bool IsTerminalStatus(TestRunStatus status)
std::string FormatOptionalTime(const std::optional< absl::Time > &time)
std::string YamlQuote(absl::string_view value)
std::string OptionalTimeToYaml(const std::optional< absl::Time > &time)
std::string HarnessAddress(const std::string &host, int port)
const char * TestRunStatusToString(TestRunStatus status)
std::string JsonEscape(absl::string_view value)
std::string OptionalTimeToJson(const std::optional< absl::Time > &time)
std::string OptionalTimeToIso(const std::optional< absl::Time > &time)
std::optional< TestRunStatus > ParseStatusFilter(absl::string_view value)
std::optional< WidgetTypeFilter > ParseWidgetTypeFilter(absl::string_view value)
TestRunStatus
Execution status codes returned by the harness.
Main namespace for the application.