c-c perma xpcshell-remote.toml:toolkit/components/extensions/test/xpcshell/test_ext_runtime_getContexts.js | xpcshell return code: 0
Categories
(Thunderbird :: Add-Ons: Extensions API, defect, P5)
Tracking
(thunderbird_esr115 unaffected)
Tracking | Status | |
---|---|---|
thunderbird_esr115 | --- | unaffected |
People
(Reporter: intermittent-bug-filer, Assigned: TbSync)
References
Details
(Keywords: intermittent-failure, intermittent-testcase, Whiteboard: [stockwell disable-recommended])
Attachments
(1 file)
Filed by: mkmelin [at] iki.fi
Parsed log: https://treeherder.mozilla.org/logviewer?job_id=456607109&repo=comm-central
Full log: https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/HM9-tYY3QCecnmV5X5cJbQ/runs/0/artifacts/public/logs/live_backing.log
Comment 2•2 months ago
|
||
[task 2024-05-02T05:14:37.652Z] 05:14:37 INFO - TEST-PASS | xpcshell-remote.toml:toolkit/components/extensions/test/xpcshell/test_ext_runtime_getContexts.js | test_runtime_getContexts - [test_runtime_getContexts : 100] Got the expected error message - "Error: Incorrect argument types for runtime.getContexts." == "Error: Incorrect argument types for runtime.getContexts."
[task 2024-05-02T05:14:37.652Z] 05:14:37 INFO - "Test runtime.getContext resolved when called with an empty filter parameter"
[task 2024-05-02T05:14:37.652Z] 05:14:37 INFO - "CONSOLE_MESSAGE: (error) [JavaScript Error: "tabTracker.getBrowserDataForContext is not a function" {file: "resource://gre/modules/ExtensionParent.sys.mjs" line: 786}]
[task 2024-05-02T05:14:37.652Z] 05:14:37 INFO - toExtensionContext@resource://gre/modules/ExtensionParent.sys.mjs:786:44
[task 2024-05-02T05:14:37.653Z] 05:14:37 INFO - getContexts@chrome://extensions/content/parent/ext-runtime.js:151:28
Comment 3•2 months ago
|
||
https://searchfox.org/mozilla-central/rev/f1532761de0b60337e42c6c3f525288a523dabef/toolkit/components/extensions/ExtensionParent.sys.mjs#786 -- getBrowserDataForContext
is from ext-browser.js. Thunderbird doesn't have an ext-browser.js
John, what do you suggest?
Assignee | ||
Comment 4•2 months ago
|
||
We have to add it to our own TabTracker:
https://searchfox.org/comm-central/source/mail/components/extensions/parent/ext-mail.js#626
But at the moment I do not even know what this is supposed to return. I can look at this tomorrow.
Comment 5•2 months ago
|
||
(In reply to John Bieling (:TbSync) from comment #4)
We have to add it to our own TabTracker:
https://searchfox.org/comm-central/source/mail/components/extensions/parent/ext-mail.js#626But at the moment I do not even know what this is supposed to return. I can look at this tomorrow.
I confirm that to be the case: Thunderbird tabTracker subclass will have to implement the getBrowserDataForContext
as we did for Firefox Desktop in ext-browser.js and for Fenix in ext-android.js of the original patch.
I guess for tabs and background the implementation for Thunderbird may likely match the one that we have for Firefox desktop (given that in that case we just use the pre-existing getBrowserData
method internally), for popup and sidebar I'm not sure (it may be the same as Firefox Desktop if the browser elements where the popup and sidebar extension pages are loaded are at the same level of nesting from the chrome privileged window document as the ones we use in Firefox Desktop).
Feel free to ping me here or on phabricator if turns out that isn't the case and I may be able to help to determine how the corresponding implementation for Thunderbird may have to look like.
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Assignee | ||
Comment 11•2 months ago
|
||
@Luca : I have two issues:
-
Currently, we do return a
windowId
for thecontextType: TAB
case in the xpcshell test, and not -1, which fails the test. Will try to find a different implementation to make it return -1, but if that does not work, could we exclude the -1 check in the test? -
We do not (!) see the
contextType: TAB
case returned bybrowser.runtime.getContexts({});
in the actual app. In the xpcshell test, the tab is loaded viaExtensionTestUtils.loadContentPage()
which creates the browser in ContentPage().
Our own openTab() implementation seems to be missing something, and recvCreateProxyContext is never called. Do you happen to know what magic piece is needed to get it called when the browser is created?
I saw that we do not set initialBrowsingContextGroupId
, but even after adding that it does not work.
Comment hidden (Intermittent Failures Robot) |
Assignee | ||
Comment 13•2 months ago
|
||
I found the answer for #2.
Assignee | ||
Comment 14•2 months ago
|
||
This is adding the required changes to make runtime.getContexts()
work
in Thunderbird.
This also adds a mochitest, which is based on this m-c test:
/browser/components/extensions/test/browser/browser_ext_runtime_getContexts.js
Assignee | ||
Updated•2 months ago
|
Updated•2 months ago
|
Comment 15•2 months ago
|
||
Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/fc5cccd4bb60
Add support for browser.runtime.getContexts(). r=mkmelin
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Description
•