Commit d3ce9196 authored by Aaron Leventhal's avatar Aaron Leventhal Committed by Aaron Leventhal

Fix flaky AccessibilityLabelUpdates test

When a <label> changes, Blink uses PostNotification() for the name change
on the element pointed to, but DeferTreeUpdate() for the contents of
the label element itself. Therefore, the updates can occur at slightly
different times.

Bug: 1000965
Change-Id: I9d20da6f205c21aeb93e3237009fa905233ad1d6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1803595
Auto-Submit: Aaron Leventhal <aleventhal@chromium.org>
Reviewed-by: default avatarNektarios Paisios <nektar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#697232}
parent 50b3b7c8
...@@ -1667,9 +1667,7 @@ IN_PROC_BROWSER_TEST_P(DumpAccessibilityTreeTest, AccessibilityLabel) { ...@@ -1667,9 +1667,7 @@ IN_PROC_BROWSER_TEST_P(DumpAccessibilityTreeTest, AccessibilityLabel) {
RunHtmlTest(FILE_PATH_LITERAL("label.html")); RunHtmlTest(FILE_PATH_LITERAL("label.html"));
} }
// TODO(http://crubg/1000965): flaky. IN_PROC_BROWSER_TEST_P(DumpAccessibilityTreeTest, AccessibilityLabelUpdates) {
IN_PROC_BROWSER_TEST_P(DumpAccessibilityTreeTest,
DISABLED_AccessibilityLabelUpdates) {
RunHtmlTest(FILE_PATH_LITERAL("label-updates.html")); RunHtmlTest(FILE_PATH_LITERAL("label-updates.html"));
} }
......
...@@ -6,7 +6,15 @@ rootWebArea ...@@ -6,7 +6,15 @@ rootWebArea
++++++genericContainer ignored invisible ++++++genericContainer ignored invisible
++++++++genericContainer ignored invisible ++++++++genericContainer ignored invisible
++++++++++staticText ignored invisible name='oranges' ++++++++++staticText ignored invisible name='oranges'
++++textField name='oranges'
++++++genericContainer
++++labelText ignored invisible
++++++genericContainer ignored invisible
++++++++genericContainer ignored invisible
++++++++++staticText ignored invisible name='oranges'
++++textField name='bananas' ++++textField name='bananas'
++++++genericContainer ++++++genericContainer
++++labelText ignored invisible ++++labelText ignored invisible
++++++staticText ignored invisible name='bananas' ++++++staticText ignored invisible name='bananas'
++++textField name='finished'
++++++genericContainer
<!-- <!--
@WAIT-FOR:bananas @WAIT-FOR:finished
@BLINK-DENY:nameFrom* @BLINK-DENY:nameFrom*
--> -->
<!DOCTYPE html> <!DOCTYPE html>
...@@ -9,18 +9,29 @@ ...@@ -9,18 +9,29 @@
<label id="label1" aria-hidden="true" for="input1"><span><span>apples</span></span></label> <label id="label1" aria-hidden="true" for="input1"><span><span>apples</span></span></label>
<input id="input2"> <input id="input2">
<label id="label2" aria-hidden="true" for="input2">grapes</label> <label id="label2" aria-hidden="true" for="input2"><span><span>apples</span></span></label>
<input id="input3">
<label id="label3" aria-hidden="true" for="input3">grapes</label>
<input id="input4">
</div> </div>
<script> <script>
setTimeout(() => { setTimeout(() => {
const label1 = document.getElementById('label1'); const label1 = document.getElementById('label1');
label1.firstElementChild.firstElementChild.innerText = 'oranges'; label1.firstElementChild.firstElementChild.innerText = 'oranges';
const label2 = document.getElementById('label2'); const label2 = document.getElementById('label2');
const text2 = label2.firstChild; label2.firstElementChild.firstElementChild.innerText = 'oranges';
text2.deleteData(0,5); // Delete 'grape'
text2.insertData(0,'banana'); // Text should now be 'bananas' const label3 = document.getElementById('label3');
const text3 = label3.firstChild;
text3.deleteData(0,5); // Delete 'grape'
text3.insertData(0,'banana'); // Text should now be 'bananas'
setTimeout(() => {
const input4 = document.getElementById('input4');
input4.setAttribute('aria-label', 'finished');
}, 0);
}, 100); }, 100);
</script> </script>
</body> </body>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment