diff --git a/front_end/legacy_test_runner/heap_profiler_test_runner/heap_profiler_test_runner.js b/front_end/legacy_test_runner/heap_profiler_test_runner/heap_profiler_test_runner.js index 46a67763955..cfe027d2159 100644 --- a/front_end/legacy_test_runner/heap_profiler_test_runner/heap_profiler_test_runner.js +++ b/front_end/legacy_test_runner/heap_profiler_test_runner/heap_profiler_test_runner.js @@ -435,8 +435,18 @@ HeapProfilerTestRunner.checkArrayIsSorted = function(contents, sortType, sortOrd return (a < b ? -1 : (a > b ? 1 : 0)); } - function parseSize(size) { - return parseInt(size.replace(/[\xa0,]/g, ''), 10); + function parseSize(str) { + const number = parseFloat(str); + if (str.includes('kB')) { + return number * 1000; + } + if (str.includes('MB')) { + return number * 1000 * 1000; + } + if (str.includes('GB')) { + return number * 1000 * 1000 * 1000; + } + return number; } const extractor = {