diff --git a/toolkit/components/aboutmemory/tests/test_memoryReporters.xul b/toolkit/components/aboutmemory/tests/test_memoryReporters.xul index 4810443450d3..d9f1b81064e3 100644 --- a/toolkit/components/aboutmemory/tests/test_memoryReporters.xul +++ b/toolkit/components/aboutmemory/tests/test_memoryReporters.xul @@ -39,6 +39,11 @@ const COUNT_CUMULATIVE = Ci.nsIMemoryReporter.UNITS_COUNT_CUMULATIVE; const PERCENTAGE = Ci.nsIMemoryReporter.UNITS_PERCENTAGE; + // Use backslashes instead of forward slashes due to memory reporting's hacky + // handling of URLs. + const XUL_NS = + "http:\\\\www.mozilla.org\\keymaster\\gatekeeper\\there.is.only.xul"; + let vsizeAmounts = []; let residentAmounts = []; let heapAllocatedAmounts = []; @@ -119,13 +124,16 @@ function handleReportAnonymized(aProcess, aPath, aKind, aUnits, aAmount, aDescription) { + // Path might include an xmlns using http, which is safe to ignore. + let reducedPath = aPath.replace(XUL_NS, ""); + // Shouldn't get http: or https: in any paths. - if (aPath.includes('http:')) { + if (reducedPath.includes('http:')) { present.httpWhenAnonymized = aPath; } // file: URLs should have their path anonymized. - if (aPath.search('file:..[^<]') !== -1) { + if (reducedPath.search('file:..[^<]') !== -1) { present.unanonymizedFilePathWhenAnonymized = aPath; } } @@ -391,4 +399,3 @@ ]]> -