Skip to content
This repository was archived by the owner on Jun 24, 2022. It is now read-only.

Commit 1ffa7b9

Browse files
[ Mac ] Layout Test accessibility/mac/press-not-work-for-disabled-menu-list.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=196505 <rdar://problem/49532620> Patch by Andres Gonzalez <[email protected]> on 2019-08-02 Reviewed by Chris Fleizach. Re-wrote test in a timing independent way. This should fix the intermittent failures. * accessibility/mac/press-not-work-for-disabled-menu-list.html: git-svn-id: http://svn.webkit.org/repository/webkit/trunk@248189 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent 9236754 commit 1ffa7b9

File tree

2 files changed

+28
-18
lines changed

2 files changed

+28
-18
lines changed

LayoutTests/ChangeLog

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
2019-08-02 Andres Gonzalez <[email protected]>
2+
3+
[ Mac ] Layout Test accessibility/mac/press-not-work-for-disabled-menu-list.html is a flaky failure
4+
https://bugs.webkit.org/show_bug.cgi?id=196505
5+
<rdar://problem/49532620>
6+
7+
Reviewed by Chris Fleizach.
8+
9+
Re-wrote test in a timing independent way. This should fix the intermittent failures.
10+
* accessibility/mac/press-not-work-for-disabled-menu-list.html:
11+
112
2019-08-02 Yury Semikhatsky <[email protected]>
213

314
Web Inspector: Crash when interacting with Template Content in Console

LayoutTests/accessibility/mac/press-not-work-for-disabled-menu-list.html

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -42,34 +42,33 @@
4242
description("This tests that menu lists that are disabled will not be triggered by AXPress actions.");
4343

4444
// We don't test for enabled controls because opening menu lists waits on the UI process to display the menu.
45-
var numOfTests = 3, notificationCount = 0;
45+
var testCount = 3, testIndex = 0;
4646
var lists = [null, null, null];
47-
if (window.accessibilityController) {
48-
jsTestIsAsync = true;
49-
pressNext(0);
50-
}
5147

52-
function pressNext(testId) {
53-
if (testId > numOfTests)
48+
function testNextList() {
49+
if (testIndex >= testCount) {
50+
finishJSTest();
5451
return;
55-
var menulist = accessibilityController.accessibleElementById("test" + testId);
52+
}
53+
54+
var menulist = accessibilityController.accessibleElementById("test" + testIndex);
5655
menulist.addNotificationListener(pressListener);
5756
menulist.press();
58-
lists[testId] = menulist;
59-
window.setTimeout(function() {
60-
pressNext(testId + 1);
61-
}, 0);
57+
lists[testIndex] = menulist;
6258
}
6359

6460
function pressListener(notification) {
65-
if (notification == "AXPressDidFail" || notification == "AXPressDidSucceed")
66-
notificationCount++;
61+
lists[testIndex].removeNotificationListener(pressListener);
6762

6863
debug("Got notification: " + notification);
69-
lists[notificationCount-1].removeNotificationListener(pressListener);
70-
if (notificationCount == numOfTests) {
71-
finishJSTest();
72-
}
64+
65+
testIndex++;
66+
testNextList();
67+
}
68+
69+
if (window.accessibilityController) {
70+
jsTestIsAsync = true;
71+
testNextList();
7372
}
7473
</script>
7574

0 commit comments

Comments
 (0)