summaryrefslogtreecommitdiff
path: root/chromium/components/services/heap_profiling
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-12 14:27:29 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-13 09:35:20 +0000
commitc30a6232df03e1efbd9f3b226777b07e087a1122 (patch)
treee992f45784689f373bcc38d1b79a239ebe17ee23 /chromium/components/services/heap_profiling
parent7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3 (diff)
downloadqtwebengine-chromium-85-based.tar.gz
BASELINE: Update Chromium to 85.0.4183.14085-based
Change-Id: Iaa42f4680837c57725b1344f108c0196741f6057 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/components/services/heap_profiling')
-rw-r--r--chromium/components/services/heap_profiling/json_exporter_unittest.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/chromium/components/services/heap_profiling/json_exporter_unittest.cc b/chromium/components/services/heap_profiling/json_exporter_unittest.cc
index 673ac2a7a34..ccb60ea6eda 100644
--- a/chromium/components/services/heap_profiling/json_exporter_unittest.cc
+++ b/chromium/components/services/heap_profiling/json_exporter_unittest.cc
@@ -425,13 +425,13 @@ TEST(ProfilingJsonExporterTest, LargeAllocation) {
std::string json = ExportMemoryMapsAndV2StackTraceToJSON(&params);
// JSON should parse.
- base::JSONReader json_reader(base::JSON_PARSE_RFC);
- base::Optional<base::Value> result = json_reader.ReadToValue(json);
- ASSERT_TRUE(result.has_value()) << json_reader.GetErrorMessage();
+ base::JSONReader::ValueWithError parsed_json =
+ base::JSONReader::ReadAndReturnValueWithError(json);
+ ASSERT_TRUE(parsed_json.value) << parsed_json.error_message;
// Validate the allocators summary.
const base::Value* malloc_summary =
- result.value().FindPath({"allocators", "malloc"});
+ parsed_json.value->FindPath({"allocators", "malloc"});
ASSERT_TRUE(malloc_summary);
const base::Value* malloc_size =
malloc_summary->FindPath({"attrs", "size", "value"});
@@ -445,7 +445,7 @@ TEST(ProfilingJsonExporterTest, LargeAllocation) {
// Validate allocators details.
// heaps_v2.allocators.malloc.sizes.reduce((a,s)=>a+s,0).
const base::Value* malloc =
- result.value().FindPath({"heaps_v2", "allocators", "malloc"});
+ parsed_json.value->FindPath({"heaps_v2", "allocators", "malloc"});
const base::Value* malloc_sizes = malloc->FindKey("sizes");
EXPECT_EQ(1u, malloc_sizes->GetList().size());
EXPECT_EQ(0x9876543210ul, malloc_sizes->GetList()[0].GetDouble());