The `gBrowser.reloadTab` method was doing a very light reload, which could preserve iframe overriden locations. The new method ensures we load the original HTML content back, this seems to also have an impact on keep-alive which is not longer guaranteed. Only supports reloading the currently selected tab, to better replicate real user scenarios. But also to comply to `BrowserCommands.reload`, which only supports reloading the selected tab. Also tune the har test, now that requests are really cancelled and we may try to fetch reponse content for such request. Differential Revision: https://phabricator.services.mozilla.com/D277433
34 lines
1005 B
JavaScript
34 lines
1005 B
JavaScript
/* Any copyright is dedicated to the Public Domain.
|
|
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
|
|
|
"use strict";
|
|
|
|
const VALID_JSON_URL = URL_ROOT + "valid_json.json";
|
|
|
|
add_task(async function () {
|
|
info("Test focus JSON view started");
|
|
await addJsonViewTab(VALID_JSON_URL);
|
|
|
|
await SpecialPowers.spawn(gBrowser.selectedBrowser, [], async () => {
|
|
const scroller = content.document.getElementById("json-scrolling-panel");
|
|
ok(scroller, "Found the scrollable area");
|
|
is(
|
|
content.document.activeElement,
|
|
scroller,
|
|
"Scrollable area initially focused"
|
|
);
|
|
});
|
|
await reloadSelectedTab();
|
|
await SpecialPowers.spawn(gBrowser.selectedBrowser, [], async () => {
|
|
const scroller = await ContentTaskUtils.waitForCondition(
|
|
() => content.document.getElementById("json-scrolling-panel"),
|
|
"Wait for the panel to be loaded"
|
|
);
|
|
is(
|
|
content.document.activeElement,
|
|
scroller,
|
|
"Scrollable area focused after reload"
|
|
);
|
|
});
|
|
});
|