commit 983d1d4f34e4e93002dca7aa50926ec3fdd0fcba
parent 66085b85b371d0cf577bae9e0e433fbe999f3a8f
Author: James Teh <jteh@mozilla.com>
Date: Thu, 16 Oct 2025 00:43:32 +0000
Bug 1994356 part 2: Move the implicit selected state test from browser_caching_states.js to states/browser_test_selection.js. r=morgan
This just moves the test with no other changes.
Previously, we had tests related to the implicit selected state in two different places, which is confusing at best.
Also, any progress we can make towards organising the wild dumping ground of tests in e10s/ is a good thing.
Differential Revision: https://phabricator.services.mozilla.com/D268661
Diffstat:
2 files changed, 54 insertions(+), 54 deletions(-)
diff --git a/accessible/tests/browser/e10s/browser_caching_states.js b/accessible/tests/browser/e10s/browser_caching_states.js
@@ -434,60 +434,6 @@ addAccessibleTask(
);
/**
- * Test implicit selected state.
- */
-addAccessibleTask(
- `
-<div role="tablist">
- <div id="noSel" role="tab" tabindex="0">noSel</div>
- <div id="noSel2" role="tab" tabindex="0">noSel2</div>
-</div>
-<div role="listbox" aria-multiselectable="true">
- <div id="multiNoSel" role="option" tabindex="0">multiNoSel</div>
-</div>
-<div role="grid">
- <div role="row">
- <div id="gridcell" role="gridcell" tabindex="0">gridcell</div>
- </div>
-</div>
- `,
- async function (browser, docAcc) {
- const noSel = findAccessibleChildByID(docAcc, "noSel");
- testStates(noSel, 0, 0, STATE_FOCUSED | STATE_SELECTED, 0);
- info("Focusing noSel");
- let focused = waitForEvent(EVENT_FOCUS, noSel);
- noSel.takeFocus();
- await focused;
- testStates(noSel, STATE_FOCUSED | STATE_SELECTED, 0, 0, 0);
-
- const noSel2 = findAccessibleChildByID(docAcc, "noSel2");
- testStates(noSel2, 0, 0, STATE_FOCUSED | STATE_SELECTED, 0);
- info("Focusing noSel2");
- focused = waitForEvent(EVENT_FOCUS, noSel2);
- noSel2.takeFocus();
- await focused;
- testStates(noSel2, STATE_FOCUSED | STATE_SELECTED, 0, 0, 0);
-
- const multiNoSel = findAccessibleChildByID(docAcc, "multiNoSel");
- testStates(multiNoSel, 0, 0, STATE_FOCUSED | STATE_SELECTED, 0);
- info("Focusing multiNoSel");
- focused = waitForEvent(EVENT_FOCUS, multiNoSel);
- multiNoSel.takeFocus();
- await focused;
- testStates(multiNoSel, STATE_FOCUSED, 0, STATE_SELECTED, 0);
-
- const gridcell = findAccessibleChildByID(docAcc, "gridcell");
- testStates(gridcell, 0, 0, STATE_FOCUSED | STATE_SELECTED, 0);
- info("Focusing gridcell");
- focused = waitForEvent(EVENT_FOCUS, gridcell);
- gridcell.takeFocus();
- await focused;
- testStates(gridcell, STATE_FOCUSED, 0, STATE_SELECTED, 0);
- },
- { topLevel: true, iframe: true, remoteIframe: true, chrome: true }
-);
-
-/**
* Test invalid state determined via DOM.
*/
addAccessibleTask(
diff --git a/accessible/tests/browser/states/browser_test_selection.js b/accessible/tests/browser/states/browser_test_selection.js
@@ -4,6 +4,60 @@
"use strict";
+/**
+ * Test implicit selected state.
+ */
+addAccessibleTask(
+ `
+<div role="tablist">
+ <div id="noSel" role="tab" tabindex="0">noSel</div>
+ <div id="noSel2" role="tab" tabindex="0">noSel2</div>
+</div>
+<div role="listbox" aria-multiselectable="true">
+ <div id="multiNoSel" role="option" tabindex="0">multiNoSel</div>
+</div>
+<div role="grid">
+ <div role="row">
+ <div id="gridcell" role="gridcell" tabindex="0">gridcell</div>
+ </div>
+</div>
+ `,
+ async function (browser, docAcc) {
+ const noSel = findAccessibleChildByID(docAcc, "noSel");
+ testStates(noSel, 0, 0, STATE_FOCUSED | STATE_SELECTED, 0);
+ info("Focusing noSel");
+ let focused = waitForEvent(EVENT_FOCUS, noSel);
+ noSel.takeFocus();
+ await focused;
+ testStates(noSel, STATE_FOCUSED | STATE_SELECTED, 0, 0, 0);
+
+ const noSel2 = findAccessibleChildByID(docAcc, "noSel2");
+ testStates(noSel2, 0, 0, STATE_FOCUSED | STATE_SELECTED, 0);
+ info("Focusing noSel2");
+ focused = waitForEvent(EVENT_FOCUS, noSel2);
+ noSel2.takeFocus();
+ await focused;
+ testStates(noSel2, STATE_FOCUSED | STATE_SELECTED, 0, 0, 0);
+
+ const multiNoSel = findAccessibleChildByID(docAcc, "multiNoSel");
+ testStates(multiNoSel, 0, 0, STATE_FOCUSED | STATE_SELECTED, 0);
+ info("Focusing multiNoSel");
+ focused = waitForEvent(EVENT_FOCUS, multiNoSel);
+ multiNoSel.takeFocus();
+ await focused;
+ testStates(multiNoSel, STATE_FOCUSED, 0, STATE_SELECTED, 0);
+
+ const gridcell = findAccessibleChildByID(docAcc, "gridcell");
+ testStates(gridcell, 0, 0, STATE_FOCUSED | STATE_SELECTED, 0);
+ info("Focusing gridcell");
+ focused = waitForEvent(EVENT_FOCUS, gridcell);
+ gridcell.takeFocus();
+ await focused;
+ testStates(gridcell, STATE_FOCUSED, 0, STATE_SELECTED, 0);
+ },
+ { topLevel: true, iframe: true, remoteIframe: true, chrome: true }
+);
+
// Ensure explicit selection gets priority over implicit selection
addAccessibleTask(
`