Perma [tier 2] toolkit/mozapps/extensions/test/browser/browser_permission_prompt_userScripts.js | uncaught exception - TypeError: can't access property "todo", SpecialPowers.SimpleTest is undefined at a11yWarn@chrome://mochikit/content/tests/SimpleTest/
Categories
(Toolkit :: Add-ons Manager, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox-esr128 | --- | unaffected |
firefox134 | --- | unaffected |
firefox135 | --- | affected |
firefox136 | --- | affected |
People
(Reporter: intermittent-bug-filer, Assigned: Jamie)
References
(Regression)
Details
(4 keywords, Whiteboard: [stockwell disabled])
Attachments
(2 files)
Filed by: chorotan [at] mozilla.com
Parsed log: https://treeherder.mozilla.org/logviewer?job_id=489404646&repo=autoland
Full log: https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/VWeE0r9kT_S-Dx8xDpavQQ/runs/0/artifacts/public/logs/live_backing.log
task 2025-01-09T15:29:24.778Z] 15:29:24 INFO - TEST-PASS | toolkit/mozapps/extensions/test/browser/browser_permission_prompt_userScripts.js | Initial checkbox state -
[task 2025-01-09T15:29:24.778Z] 15:29:24 INFO - Buffered messages finished
[task 2025-01-09T15:29:24.781Z] 15:29:24 INFO - TEST-UNEXPECTED-FAIL | toolkit/mozapps/extensions/test/browser/browser_permission_prompt_userScripts.js | uncaught exception - TypeError: can't access property "todo", SpecialPowers.SimpleTest is undefined at a11yWarn@chrome://mochikit/content/tests/SimpleTest/AccessibilityUtils.js:768:5
[task 2025-01-09T15:29:24.781Z] 15:29:24 INFO - assertLabelled@chrome://mochikit/content/tests/SimpleTest/AccessibilityUtils.js:981:17
[task 2025-01-09T15:29:24.781Z] 15:29:24 INFO - assertCanBeClicked@chrome://mochikit/content/tests/SimpleTest/AccessibilityUtils.js:1176:21
[task 2025-01-09T15:29:24.782Z] 15:29:24 INFO - runIfA11YChecks/this.AccessibilityUtils@chrome://mochikit/content/tests/SimpleTest/AccessibilityUtils.js:1140:40
[task 2025-01-09T15:29:24.782Z] 15:29:24 INFO - handleEvent@chrome://mochikit/content/tests/SimpleTest/AccessibilityUtils.js:1257:12
[task 2025-01-09T15:29:24.782Z] 15:29:24 INFO - toggleUserScriptCheckbox@chrome://mochitests/content/browser/toolkit/mozapps/extensions/test/browser/browser_permission_prompt_userScripts.js:116:12
[task 2025-01-09T15:29:24.782Z] 15:29:24 INFO - verifyUserScriptPromptDeniedByDefault@chrome://mochitests/content/browser/toolkit/mozapps/extensions/test/browser/browser_permission_prompt_userScripts.js:165:31
[task 2025-01-09T15:29:24.782Z] 15:29:24 INFO - async*test_userScripts_not_allowed_by_default@chrome://mochitests/content/browser/toolkit/mozapps/extensions/test/browser/browser_permission_prompt_userScripts.js:203:9
[task 2025-01-09T15:29:24.782Z] 15:29:24 INFO - async*handleTask@chrome://mochikit/content/browser-test.js:1147:26
[task 2025-01-09T15:29:24.782Z] 15:29:24 INFO - _runTaskBasedTest@chrome://mochikit/content/browser-test.js:1219:18
[task 2025-01-09T15:29:24.782Z] 15:29:24 INFO - async*Tester_execTest@chrome://mochikit/content/browser-test.js:1360:14
[task 2025-01-09T15:29:24.782Z] 15:29:24 INFO - nextTest/<@chrome://mochikit/content/browser-test.js:1136:14
[task 2025-01-09T15:29:24.782Z] 15:29:24 INFO - SimpleTest.waitForFocus/<@chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:1058:13
[task 2025-01-09T15:29:24.782Z] 15:29:24 INFO -
[task 2025-01-09T15:29:24.782Z] 15:29:24 INFO - Stack trace:
[task 2025-01-09T15:29:24.782Z] 15:29:24 INFO - chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:simpletestOnerror:2068
[task 2025-01-09T15:29:24.782Z] 15:29:24 INFO - chrome://mochitests/content/browser/toolkit/mozapps/extensions/test/browser/browser_permission_prompt_userScripts.js:toggleUserScriptCheckbox:116
[task 2025-01-09T15:29:24.782Z] 15:29:24 INFO - chrome://mochitests/content/browser/toolkit/mozapps/extensions/test/browser/browser_permission_prompt_userScripts.js:verifyUserScriptPromptDeniedByDefault:165
[task 2025-01-09T15:29:24.782Z] 15:29:24 INFO - chrome://mochitests/content/browser/toolkit/mozapps/extensions/test/browser/browser_permission_prompt_userScripts.js:test_userScripts_not_allowed_by_default:203
[task 2025-01-09T15:29:24.782Z] 15:29:24 INFO - chrome://mochikit/content/browser-test.js:handleTask:1147
[task 2025-01-09T15:29:24.782Z] 15:29:24 INFO - chrome://mochikit/content/browser-test.js:_runTaskBasedTest:1219
[task 2025-01-09T15:29:24.782Z] 15:29:24 INFO - chrome://mochikit/content/browser-test.js:Tester_execTest:1360
[task 2025-01-09T15:29:24.782Z] 15:29:24 INFO - chrome://mochikit/content/browser-test.js:nextTest/<:1136
[task 2025-01-09T15:29:24.783Z] 15:29:24 INFO - chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:SimpleTest.waitForFocus/<:1058
[task 2025-01-09T15:29:24.783Z] 15:29:24 INFO - GECKO(12767) | JavaScript error: chrome://mochikit/content/tests/SimpleTest/AccessibilityUtils.js, line 768: TypeError: can't access property "todo", SpecialPowers.SimpleTest is undefined
[task 2025-01-09T15:29:24.784Z] 15:29:24 INFO - TEST-PASS | toolkit/mozapps/extensions/test/browser/browser_permission_prompt_userScripts.js | Checked state should change -
[task 2025-01-09T15:29:24.784Z] 15:29:24 INFO - TEST-PASS | toolkit/mozapps/extensions/test/browser/browser_permission_prompt_userScripts.js | Should be able to Deny the prompt -
[task 2025-01-09T15:29:24.786Z] 15:29:24 INFO - Console message: [JavaScript Error: "TypeError: can't access property "todo", SpecialPowers.SimpleTest is undefined" {file: "chrome://mochikit/content/tests/SimpleTest/AccessibilityUtils.js" line: 768}]
[task 2025-01-09T15:29:24.786Z] 15:29:24 INFO - a11yWarn@chrome://mochikit/content/tests/SimpleTest/AccessibilityUtils.js:768:5
[task 2025-01-09T15:29:24.786Z] 15:29:24 INFO - assertLabelled@chrome://mochikit/content/tests/SimpleTest/AccessibilityUtils.js:981:17
[task 2025-01-09T15:29:24.787Z] 15:29:24 INFO - assertCanBeClicked@chrome://mochikit/content/tests/SimpleTest/AccessibilityUtils.js:1176:21
[task 2025-01-09T15:29:24.787Z] 15:29:24 INFO - runIfA11YChecks/this.AccessibilityUtils@chrome://mochikit/content/tests/SimpleTest/AccessibilityUtils.js:1140:40
[task 2025-01-09T15:29:24.787Z] 15:29:24 INFO - handleEvent@chrome://mochikit/content/tests/SimpleTest/AccessibilityUtils.js:1257:12
[task 2025-01-09T15:29:24.787Z] 15:29:24 INFO - toggleUserScriptCheckbox@chrome://mochitests/content/browser/toolkit/mozapps/extensions/test/browser/browser_permission_prompt_userScripts.js:116:12
[task 2025-01-09T15:29:24.787Z] 15:29:24 INFO - verifyUserScriptPromptDeniedByDefault@chrome://mochitests/content/browser/toolkit/mozapps/extensions/test/browser/browser_permission_prompt_userScripts.js:165:31
[task 2025-01-09T15:29:24.787Z] 15:29:24 INFO - async*test_userScripts_not_allowed_by_default@chrome://mochitests/content/browser/toolkit/mozapps/extensions/test/browser/browser_permission_prompt_userScripts.js:203:9
[task 2025-01-09T15:29:24.788Z] 15:29:24 INFO - async*handleTask@chrome://mochikit/content/browser-test.js:1147:26
[task 2025-01-09T15:29:24.788Z] 15:29:24 INFO - _runTaskBasedTest@chrome://mochikit/content/browser-test.js:1219:18
[task 2025-01-09T15:29:24.788Z] 15:29:24 INFO - async*Tester_execTest@chrome://mochikit/content/browser-test.js:1360:14
[task 2025-01-09T15:29:24.788Z] 15:29:24 INFO - nextTest/<@chrome://mochikit/content/browser-test.js:1136:14
[task 2025-01-09T15:29:24.788Z] 15:29:24 INFO - SimpleTest.waitForFocus/<@chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:1058:13
[task 2025-01-09T15:29:24.788Z] 15:29:24 INFO -
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Hi Rob! Could this permafailure be caused by your changes made on Bug 1931548 ? If so, could you please take a look? Thanks.
Comment 4•1 month ago
|
||
Set release status flags based on info from the regressing bug 1931548
Comment 5•1 month ago
|
||
While bug 1931548 added a new test, I am not sure if this is really an issue with my patches.
I simulate a checkbox change with checkbox.click()
at https://searchfox.org/mozilla-central/rev/9f9fa5d2cb72b12ac7e168b7f6ee9820f63291e9/toolkit/mozapps/extensions/test/browser/browser_permission_prompt_userScripts.js#115-116.
The checkbox is visible, with a label - nothing special: https://searchfox.org/mozilla-central/rev/9f9fa5d2cb72b12ac7e168b7f6ee9820f63291e9/browser/base/content/browser-addons.js#345-351
When a11y checks are enabled, that apparently triggers an error at https://searchfox.org/mozilla-central/rev/9f9fa5d2cb72b12ac7e168b7f6ee9820f63291e9/testing/mochitest/tests/SimpleTest/AccessibilityUtils.js#755. This error is independent of my test.
The error is in an attempt to call SimpleTest.todo
, which should have been a non-fatal error. The intended result is to log "Form elements should have a visible text label" at https://searchfox.org/mozilla-central/rev/9f9fa5d2cb72b12ac7e168b7f6ee9820f63291e9/testing/mochitest/tests/SimpleTest/AccessibilityUtils.js#981
Oddly, when I run the test on macOS, I don't get any failures (nor warnings):
./mach test toolkit/mozapps/extensions/test/browser/browser_permission_prompt_userScripts.js --headless --log-mach-verbose --enable-a11y-checks
Comment 6•1 month ago
|
||
Anna, see comment 5 and the summary below. Do you know what is going on here?
<checkbox>
with label created at https://searchfox.org/mozilla-central/rev/9f9fa5d2cb72b12ac7e168b7f6ee9820f63291e9/browser/base/content/browser-addons.js#345-351<checkbox>
custom element defined at https://searchfox.org/mozilla-central/source/toolkit/content/widgets/checkbox.js- Checkbox toggled by
checkbox.click()
at https://searchfox.org/mozilla-central/rev/9f9fa5d2cb72b12ac7e168b7f6ee9820f63291e9/toolkit/mozapps/extensions/test/browser/browser_permission_prompt_userScripts.js#115-116
For some reason, AccessibilityUtils.js
thinks that the checkbox does not have a form label, on Linux only (not on macOS), at https://searchfox.org/mozilla-central/rev/9f9fa5d2cb72b12ac7e168b7f6ee9820f63291e9/testing/mochitest/tests/SimpleTest/AccessibilityUtils.js#981.
That would ordinarily have been a non-fatal warning, but somehow SpecialPowers.SimpleTest
is undefined
at that point, causing a failure upon calling SpecialPowers.SimpleTest.todo
at https://searchfox.org/mozilla-central/rev/9f9fa5d2cb72b12ac7e168b7f6ee9820f63291e9/testing/mochitest/tests/SimpleTest/AccessibilityUtils.js#755
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment 10•1 month ago
|
||
This is not unique to browser_permission_prompt_userScripts.js
, here is a try push with the same error for browser_installtrigger_install.js
.
Comment hidden (Intermittent Failures Robot) |
Comment 12•1 month ago
|
||
This test currently permafails, see
https://bugzilla.mozilla.org/show_bug.cgi?id=1940773#c5 and
https://bugzilla.mozilla.org/show_bug.cgi?id=1940773#c6
Disabling test on a11y_checks until the underlying issue is addressed.
Comment 13•1 month ago
|
||
I'm going to skip the test when running with a11y_checks
, since the failures are not helpful. There is a pending needinfo in comment 6 that blocks the "proper" resolution of this bug.
Comment hidden (Intermittent Failures Robot) |
Comment 15•29 days ago
|
||
Comment 16•29 days ago
|
||
bugherder |
Updated•25 days ago
|
Comment hidden (Intermittent Failures Robot) |
Assignee | ||
Comment 19•6 days ago
|
||
For some reason I don't understand, window.SpecialPowers.SimpleTest and window.SimpleTest sometimes seem to be cleared during tests (or the global scope changes completely).
Ultimately, we don't control the test scope, so it's best not to rely on it anyway.
Instead, save a reference to SimpleTest in the AccessibilityUtils scope in AccessibilityUtils.init so we can always rely on it being there, since AccessibilityUtils completely controls that scope.
This patch also re-enables the test which was perma failing on CI.
Comment 20•2 days ago
|
||
While this fixes the error, there is still the issue of why the todo()
was triggered. I described the circumstances leading to this error at https://bugzilla.mozilla.org/show_bug.cgi?id=1940773#c6
Do you know why that is happening? Sounds like a potential issue with a11y tests or an a11y bug in the checkbox implementation.
Assignee | ||
Comment 21•2 days ago
|
||
(In reply to Rob Wu [:robwu] from comment #20)
While this fixes the error, there is still the issue of why the
todo()
was triggered.
Fair. However, I'd suggest we tackle this in a separate bug, since the error is hurting us, where the warning likely isn't, and the fixes are going to be very different.
(In reply to Rob Wu [:robwu] from comment #6)
For some reason,
AccessibilityUtils.js
thinks that the checkbox does not have a form label, on Linux only (not on macOS)
Note that a11y-checks jobs only run on CI for Linux. There can also be timing issues with Fluent that cause a11y-checks to not be able to examine the label in time, in which case we will pass silently rather than failing. There's not much we can do about that.
Looking at this briefly, I think this might be happening because the accessibility engine knows how to get the label text for XUL controls which use label="text"
, but not the label element itself. The label element possibly isn't even in the accessibility tree because check boxes aren't supposed to have children in accessibility terms. So, I think the fix here will probably be to make an exception to avoid this warning in this case in AccessibilityUtils.
Comment 22•1 day ago
|
||
(In reply to James Teh [:Jamie] from comment #21)
(In reply to Rob Wu [:robwu] from comment #20)
While this fixes the error, there is still the issue of why the
todo()
was triggered.Fair. However, I'd suggest we tackle this in a separate bug, since the error is hurting us, where the warning likely isn't, and the fixes are going to be very different.
I filed bug 1950495 and quoted the relevant parts of the comments here.
Comment 23•16 hours ago
|
||
Description
•