diff --git a/mozglue/baseprofiler/public/BaseProfileJSONWriter.h b/mozglue/baseprofiler/public/BaseProfileJSONWriter.h index 511dc00734f7..596162d75b24 100644 --- a/mozglue/baseprofiler/public/BaseProfileJSONWriter.h +++ b/mozglue/baseprofiler/public/BaseProfileJSONWriter.h @@ -164,7 +164,7 @@ class UniqueJSONStrings; class SpliceableJSONWriter : public JSONWriter { public: explicit SpliceableJSONWriter(UniquePtr 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()) {} // Access the ChunkedJSONWriteFunc as reference-to-const, usually to copy data diff --git a/mozglue/tests/TestBaseProfiler.cpp b/mozglue/tests/TestBaseProfiler.cpp index a9b9c2393414..0c172b1ca0c5 100644 --- a/mozglue/tests/TestBaseProfiler.cpp +++ b/mozglue/tests/TestBaseProfiler.cpp @@ -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()); \ - 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()); \ + 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" diff --git a/tools/profiler/tests/gtest/GeckoProfiler.cpp b/tools/profiler/tests/gtest/GeckoProfiler.cpp index 1cd9cb8b8b4b..0187cf4acb9d 100644 --- a/tools/profiler/tests/gtest/GeckoProfiler.cpp +++ b/tools/profiler/tests/gtest/GeckoProfiler.cpp @@ -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)