24 i.setSource(
"DebugTracePriv::setSource unit test\n"
36DEF_TEST(DebugTracePrivSetSourceReplacesExistingText, r) {
51 "//\\\\//\\\\ third line",
67 i.writeTrace(&wstream);
70 static constexpr char kExpected[] =
71 R
"({"version":"20220209","source":["\t// first line","// \"second line\"","//\\\\//\\)"
72 R"(\\ third line"],"slots":[{"name":"SkSL_DebugTrace","columns":1,"rows":2,"index":3,)"
73 R"("groupIdx":4,"kind":5,"line":6},{"name":"Unit_Test","columns":6,"rows":7,"index":8)"
74 R"(,"kind":10,"line":11,"retval":12}],"functions":[{"name":"void testFunc();"}],"trac)"
75 R"(e":[[2],[0,5],[1,10,15],[3,20]]})";
77 std::string_view actual{reinterpret_cast<const char*
>(trace->
bytes()), trace->
size()};
80 "Expected:\n %s\n\n Actual:\n %.*s\n",
81 kExpected, (
int)actual.size(), actual.data());
85 const std::string_view kJSONTrace =
86 R
"({"version":"20220209","source":["\t// first line","// \"second line\"","//\\\\//\\)"
87 R"(\\ third line"],"slots":[{"name":"SkSL_DebugTrace","columns":1,"rows":2,"index":3,)"
88 R"("groupIdx":4,"kind":5,"line":6},{"name":"Unit_Test","columns":6,"rows":7,"index":8)"
89 R"(,"kind":10,"line":11,"retval":12}],"functions":[{"name":"void testFunc();"}],"trac)"
90 R"(e":[[2],[0,5],[1,10,15],[3,20]]})";
175 const std::string kExpected[] = {
"",
176 ".x",
".y",
".z",
".w",
177 "[0][0]",
"[0][1]",
"[0][2]",
"[0][3]",
178 "[1][0]",
"[1][1]",
"[1][2]",
"[1][3]",
179 "[2][0]",
"[2][1]",
"[2][2]",
"[2][3]",
180 "[3][0]",
"[3][1]",
"[3][2]",
"[3][3]"};
183 for (
size_t index = 0; index <
std::size(kExpected); ++index) {
DEF_TEST(DebugTracePrivSetSource, r)
#define REPORTER_ASSERT(r, cond,...)
const uint8_t * bytes() const
sk_sp< SkData > detachAsData()
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size