mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-26 04:09:50 +00:00
Bug 1774329 - Make BaseProfileJSONWriter single-lined - r=florian
Differential Revision: https://phabricator.services.mozilla.com/D152603
This commit is contained in:
parent
a05b4ea2c2
commit
dab57bac1d
@ -164,7 +164,7 @@ class UniqueJSONStrings;
|
||||
class SpliceableJSONWriter : public JSONWriter {
|
||||
public:
|
||||
explicit SpliceableJSONWriter(UniquePtr<JSONWriteFunc> aWriter)
|
||||
: JSONWriter(std::move(aWriter)) {}
|
||||
: JSONWriter(std::move(aWriter), JSONWriter::SingleLineStyle) {}
|
||||
|
||||
void StartBareList(CollectionStyle aStyle = MultiLineStyle) {
|
||||
StartCollection(scEmptyString, scEmptyString, aStyle);
|
||||
@ -325,7 +325,7 @@ class SpliceableJSONWriter : public JSONWriter {
|
||||
|
||||
class SpliceableChunkedJSONWriter final : public SpliceableJSONWriter {
|
||||
public:
|
||||
explicit SpliceableChunkedJSONWriter()
|
||||
SpliceableChunkedJSONWriter()
|
||||
: SpliceableJSONWriter(MakeUnique<ChunkedJSONWriteFunc>()) {}
|
||||
|
||||
// Access the ChunkedJSONWriteFunc as reference-to-const, usually to copy data
|
||||
|
@ -1170,14 +1170,14 @@ void CheckJSON(mozilla::baseprofiler::SpliceableJSONWriter& aWriter,
|
||||
void TestJSONTimeOutput() {
|
||||
printf("TestJSONTimeOutput...\n");
|
||||
|
||||
# define TEST(in, out) \
|
||||
do { \
|
||||
mozilla::baseprofiler::SpliceableJSONWriter writer( \
|
||||
mozilla::MakeUnique<StringWriteFunc>()); \
|
||||
writer.Start(mozilla::JSONWriter::SingleLineStyle); \
|
||||
writer.TimeDoubleMsProperty("time_ms", (in)); \
|
||||
writer.End(); \
|
||||
CheckJSON(writer, "{\"time_ms\": " out "}\n", __LINE__); \
|
||||
# define TEST(in, out) \
|
||||
do { \
|
||||
mozilla::baseprofiler::SpliceableJSONWriter writer( \
|
||||
mozilla::MakeUnique<StringWriteFunc>()); \
|
||||
writer.Start(mozilla::JSONWriter::SingleLineStyle); \
|
||||
writer.TimeDoubleMsProperty("time_ms", (in)); \
|
||||
writer.End(); \
|
||||
CheckJSON(writer, "{\"time_ms\": " out "}", __LINE__); \
|
||||
} while (false);
|
||||
|
||||
TEST(0, "0");
|
||||
@ -4861,7 +4861,7 @@ static void VerifyUniqueStringContents(
|
||||
expected += aExpectedData;
|
||||
expected += "], \"stringTable\": [";
|
||||
expected += aExpectedUniqueStrings;
|
||||
expected += "]}\n";
|
||||
expected += "]}";
|
||||
if (jsonStringView != expected) {
|
||||
fprintf(stderr,
|
||||
"Expected:\n"
|
||||
|
@ -1288,7 +1288,7 @@ void JSONWhitespaceCheck(const char* aOutput) {
|
||||
}
|
||||
}
|
||||
|
||||
EXPECT_LE(double(whitespaces) / double(length), 0.25);
|
||||
EXPECT_LE(double(whitespaces) / double(length), 0.125);
|
||||
}
|
||||
|
||||
// Does the GETTER return a non-null TYPE? (Non-critical)
|
||||
|
Loading…
x
Reference in New Issue
Block a user