Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test gets skipped with pattern: os == 'linux' && os_version == '18.04' && asan OR os == 'linux' && os_version == '18.04' && tsan OR win11_2009 && asan
- Manifest: browser/components/preferences/tests/browser.toml
/* Any copyright is dedicated to the Public Domain.
var originalWindowHeight;
registerCleanupFunction(function () {
window.resizeTo(window.outerWidth, originalWindowHeight);
while (gBrowser.tabs[1]) {
gBrowser.removeTab(gBrowser.tabs[1]);
}
});
add_task(async function () {
originalWindowHeight = window.outerHeight;
window.resizeTo(window.outerWidth, 300);
let prefs = await openPreferencesViaOpenPreferencesAPI("paneSearch", {
leaveOpen: true,
});
is(prefs.selectedPane, "paneSearch", "Search pane was selected");
let mainContent = gBrowser.contentDocument.querySelector(".main-content");
mainContent.scrollTop = 50;
is(mainContent.scrollTop, 50, "main-content should be scrolled 50 pixels");
await gBrowser.contentWindow.gotoPref("paneGeneral");
is(
mainContent.scrollTop,
0,
"Switching to a different category should reset the scroll position"
);
});