diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
commit | 26a029d407be480d791972afb5975cf62c9360a6 (patch) | |
tree | f435a8308119effd964b339f76abb83a57c29483 /browser/base/content/test/forms/browser_selectpopup_hr.js | |
parent | Initial commit. (diff) | |
download | firefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz firefox-26a029d407be480d791972afb5975cf62c9360a6.zip |
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'browser/base/content/test/forms/browser_selectpopup_hr.js')
-rw-r--r-- | browser/base/content/test/forms/browser_selectpopup_hr.js | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/browser/base/content/test/forms/browser_selectpopup_hr.js b/browser/base/content/test/forms/browser_selectpopup_hr.js new file mode 100644 index 0000000000..85a44be66c --- /dev/null +++ b/browser/base/content/test/forms/browser_selectpopup_hr.js @@ -0,0 +1,55 @@ +add_task(async function test_hr() { + await SpecialPowers.pushPrefEnv({ + set: [["dom.forms.select.customstyling", true]], + }); + + const PAGE_CONTENT = ` +<!doctype html> +<select> +<option>One</option> +<hr style="color: red; background-color: blue"> +<option>Two</option> +</select>`; + + const pageUrl = "data:text/html," + encodeURIComponent(PAGE_CONTENT); + let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, pageUrl); + + const selectPopup = await openSelectPopup("click"); + const menulist = selectPopup.parentNode; + + const optionOne = selectPopup.children[0]; + const separator = selectPopup.children[1]; + const optionTwo = selectPopup.children[2]; + + is(optionOne.textContent, "One", "First option has expected text content"); + + is(separator.tagName, "menuseparator", "Separator is menuseparator"); + + const separatorStyle = getComputedStyle(separator); + + is( + separatorStyle.color, + "rgb(255, 0, 0)", + "Separator color is specified CSS color" + ); + + is( + separatorStyle.backgroundColor, + "rgba(0, 0, 0, 0)", + "Separator background-color is not set to specified CSS color" + ); + + is(optionTwo.textContent, "Two", "Second option has expected text content"); + + is(menulist.activeChild, optionOne, "First option is selected to start"); + + EventUtils.synthesizeKey("KEY_ArrowDown"); + + is( + menulist.activeChild, + optionTwo, + "Second option is selected after arrow down" + ); + + BrowserTestUtils.removeTab(tab); +}); |