Bug 1774329 - Make BaseProfileJSONWriter single-lined - r=florian

Differential Revision: https://phabricator.services.mozilla.com/D152603
This commit is contained in:
Gerald Squelart 2022-07-28 12:41:54 +00:00
parent a05b4ea2c2
commit dab57bac1d
3 changed files with 12 additions and 12 deletions

View File

@ -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

View File

@ -1177,7 +1177,7 @@ void TestJSONTimeOutput() {
writer.Start(mozilla::JSONWriter::SingleLineStyle); \
writer.TimeDoubleMsProperty("time_ms", (in)); \
writer.End(); \
CheckJSON(writer, "{\"time_ms\": " out "}\n", __LINE__); \
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"

View File

@ -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)