Backed out changeset 596b3eff1c15 (bug 1729472) for causing mochitest failures on browser_headless_screenshot_1/2.js. CLOSED TREE

This commit is contained in:
Cristian Tuns 2021-09-14 16:02:40 -04:00
parent 4e6caf25ee
commit 763e2b4f88

View File

@ -582,29 +582,6 @@ async function devToolsActiveConfigurationHasFeature(document, feature) {
}
/* exported devToolsActiveConfigurationHasFeature */
/**
* This adapts the expectation using the current build's available profiler
* features.
* @param {string} fixture It can be either already trimmed or untrimmed.
* @returns {string}
*/
function _adaptCustomPresetExpectationToCustomBuild(fixture) {
const supportedFeatures = Services.profiler.GetFeatures();
info("Supported features are: " + supportedFeatures.join(", "));
// Some platforms do not support stack walking, we can adjust the passed
// fixture so that tests are passing in these platforms too.
// Most notably MacOS outside of Nightly and DevEdition.
if (!supportedFeatures.includes("stackwalk")) {
info(
"Supported features do not include stackwalk, let's remove the Native Stacks from the expected output."
);
fixture = fixture.replace(/^.*Native Stacks.*\n/m, "");
}
return fixture;
}
/**
* This checks if the content of the preset description equals the fixture in
* string form.
@ -614,8 +591,6 @@ function _adaptCustomPresetExpectationToCustomBuild(fixture) {
function checkDevtoolsCustomPresetContent(devtoolsDocument, fixture) {
// This removes all indentations and any start or end new line and other space characters.
fixture = fixture.replace(/^\s+/gm, "").trim();
// This removes unavailable features from the fixture content.
fixture = _adaptCustomPresetExpectationToCustomBuild(fixture);
is(devtoolsDocument.querySelector(".perf-presets-custom").innerText, fixture);
}
/* exported checkDevtoolsCustomPresetContent */