Skip to content

Commit

Permalink
Update test function in heap_profiler_test_runner.js
Browse files Browse the repository at this point in the history
Bug: 388589515
Change-Id: I8093c20087ba15276fe0a0706060d1ac5f2bfc9a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6164864
Auto-Submit: Connor Clark <[email protected]>
Commit-Queue: Connor Clark <[email protected]>
Reviewed-by: Paul Irish <[email protected]>
  • Loading branch information
Connor Clark authored and Devtools-frontend LUCI CQ committed Jan 10, 2025
1 parent 4b3bc1a commit 8284692
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down

0 comments on commit 8284692

Please sign in to comment.