Closed Bug 1934551 Opened 8 months ago Closed 6 months ago

Implement "webExtenstion.install" command

Categories

(Remote Protocol :: WebDriver BiDi, task, P3)

task

Tracking

(firefox137 fixed)

RESOLVED FIXED
137 Branch
Tracking Status
firefox137 --- fixed

People

(Reporter: whimboo, Assigned: chrmod)

References

(Blocks 4 open bugs, )

Details

(Whiteboard: [webdriver:m15][webdriver:external], [wptsync upstream][webdriver:relnote] )

Attachments

(1 file, 2 obsolete files)

We have to implement the recently added webExtension.install command.

Blocks: 1934553
Severity: -- → S3
Component: Agent → WebDriver BiDi
Priority: -- → P2
Whiteboard: [webdriver:m15]
Points: --- → 3

I would be happy to implement the new commands (install/uninstall). Given the holiday season, I think realistically can have something ready in the beginning of January.

This sounds great Krzysztof! Just let us know in case you experience issues.

Based on that lets also move it to P3 so it's not blocking.

Assignee: nobody → krzysztof.modras
Priority: P2 → P3
Whiteboard: [webdriver:m15] → [webdriver:m15][webdriver:external]
Points: 3 → ---
Attachment #9459182 - Attachment description: WIP: Bug 1934551 - [WebDriver BiDi] add webExtension module → Bug 1934551,1934553 - [WebDriver BiDi] add webExtension module
Depends on: 1941821
Attachment #9461533 - Attachment description: Bug 1934551 - [webdriver-bidi] Add webExtension module with install command r=whimboo → Bug 1934551 - [webdriver-bidi] Add support for "webExtension.install" command r=whimboo
Attachment #9461535 - Attachment description: Bug 1934551,Bug 1934553 - [wdspec] Tests webExtension module install and uninstall commands r=whimboo → Bug 1934551,Bug 1934553 - [wdspec] Tests for the installing and uninstalling webExtensions r=whimboo
Attachment #9459182 - Attachment is obsolete: true

Comment on attachment 9461535 [details]
Bug 1934551,Bug 1934553 - [wdspec] Tests for the installing and uninstalling webExtensions r=whimboo

Revision D235435 was moved to bug 1934553. Setting attachment 9461535 [details] to obsolete.

Attachment #9461535 - Attachment is obsolete: true
Blocks: 1947678
Blocks: 1947679
Blocks: 1947683
Pushed by hskupin@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/d41a6261a338 [webdriver-bidi] Add support for "webExtension.install" command r=whimboo,webdriver-reviewers

Backed out for causing remote failures @ browser_Addon.js

Backout link: https://hg.mozilla.org/integration/autoland/rev/cd51bfea93269e6d73b76fec3e66b41c5af131af

Push with failures

Failure log -> TEST-UNEXPECTED-FAIL | remote/shared/test/browser/browser_Addon.js

Buffered messages finished
[task 2025-02-13T18:14:00.096Z] 18:14:00     INFO - TEST-UNEXPECTED-FAIL | remote/shared/test/browser/browser_Addon.js | Uncaught exception in test bound test_installWithBase64_failure - at chrome://remote/content/shared/RemoteError.sys.mjs:8 - InvalidWebExtensionError: Could not install Add-on: Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIZipReader.open]
[task 2025-02-13T18:14:00.096Z] 18:14:00     INFO - Stack trace:
[task 2025-02-13T18:14:00.096Z] 18:14:00     INFO - RemoteError@chrome://remote/content/shared/RemoteError.sys.mjs:8:8
[task 2025-02-13T18:14:00.096Z] 18:14:00     INFO - WebDriverError@chrome://remote/content/shared/webdriver/Errors.sys.mjs:199:5
[task 2025-02-13T18:14:00.096Z] 18:14:00     INFO - InvalidWebExtensionError@chrome://remote/content/shared/webdriver/Errors.sys.mjs:478:5
[task 2025-02-13T18:14:00.096Z] 18:14:00     INFO - installAddon@chrome://remote/content/shared/Addon.sys.mjs:56:11
[task 2025-02-13T18:14:00.096Z] 18:14:00     INFO - async*installWithBase64@chrome://remote/content/shared/Addon.sys.mjs:116:21
[task 2025-02-13T18:14:00.096Z] 18:14:00     INFO - async*test_installWithBase64_failure@chrome://mochitests/content/browser/remote/shared/test/browser/browser_Addon.js:48:16
[task 2025-02-13T18:14:00.096Z] 18:14:00     INFO - handleTask@chrome://mochikit/content/browser-test.js:1147:26
[task 2025-02-13T18:14:00.096Z] 18:14:00     INFO - _runTaskBasedTest@chrome://mochikit/content/browser-test.js:1219:18
[task 2025-02-13T18:14:00.096Z] 18:14:00     INFO - async*Tester_execTest@chrome://mochikit/content/browser-test.js:1360:14
[task 2025-02-13T18:14:00.096Z] 18:14:00     INFO - nextTest/<@chrome://mochikit/content/browser-test.js:1136:14
[task 2025-02-13T18:14:00.096Z] 18:14:00     INFO - SimpleTest.waitForFocus/<@chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:1058:13
[task 2025-02-13T18:14:00.096Z] 18:14:00     INFO - Leaving test bound test_installWithBase64_failure
[task 2025-02-13T18:14:00.096Z] 18:14:00     INFO - Entering test bound test_uninstall
[task 2025-02-13T18:14:00.096Z] 18:14:00     INFO - TEST-PASS | remote/shared/test/browser/browser_Addon.js | undefined assertion name - 
[task 2025-02-13T18:14:00.096Z] 18:14:00     INFO - Leaving test bound test_uninstall
[task 2025-02-13T18:14:00.096Z] 18:14:00     INFO - Entering test bound test_uninstall_failure
[task 2025-02-13T18:14:00.096Z] 18:14:00     INFO - Not taking screenshot here: see the one that was previously logged
[task 2025-02-13T18:14:00.100Z] 18:14:00     INFO - TEST-UNEXPECTED-FAIL | remote/shared/test/browser/browser_Addon.js | Uncaught exception in test bound test_uninstall_failure - at chrome://remote/content/shared/RemoteError.sys.mjs:8 - NoSuchWebExtensionError: Add-on with ID "test" is not installed.
[task 2025-02-13T18:14:00.100Z] 18:14:00     INFO - Stack trace:
[task 2025-02-13T18:14:00.100Z] 18:14:00     INFO - RemoteError@chrome://remote/content/shared/RemoteError.sys.mjs:8:8
[task 2025-02-13T18:14:00.100Z] 18:14:00     INFO - WebDriverError@chrome://remote/content/shared/webdriver/Errors.sys.mjs:199:5
[task 2025-02-13T18:14:00.100Z] 18:14:00     INFO - NoSuchWebExtensionError@chrome://remote/content/shared/webdriver/Errors.sys.mjs:723:5
[task 2025-02-13T18:14:00.100Z] 18:14:00     INFO - uninstall@chrome://remote/content/shared/Addon.sys.mjs:189:13
[task 2025-02-13T18:14:00.100Z] 18:14:00     INFO - async*test_uninstall_failure@chrome://mochitests/content/browser/remote/shared/test/browser/browser_Addon.js:63:16
[task 2025-02-13T18:14:00.100Z] 18:14:00     INFO - handleTask@chrome://mochikit/content/browser-test.js:1147:26
[task 2025-02-13T18:14:00.100Z] 18:14:00     INFO - _runTaskBasedTest@chrome://mochikit/content/browser-test.js:1219:18
[task 2025-02-13T18:14:00.101Z] 18:14:00     INFO - async*Tester_execTest@chrome://mochikit/content/browser-test.js:1360:14
[task 2025-02-13T18:14:00.101Z] 18:14:00     INFO - nextTest/<@chrome://mochikit/content/browser-test.js:1136:14
[task 2025-02-13T18:14:00.101Z] 18:14:00     INFO - SimpleTest.waitForFocus/<@chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:1058:13
[task 2025-02-13T18:14:00.101Z] 18:14:00     INFO - Leaving test bound test_uninstall_failure
[task 2025-02-13T18:14:00.102Z] 18:14:00     INFO - GECKO(8603) | MEMORY STAT vsizeMaxContiguous not supported in this build configuration.
Flags: needinfo?(krzysztof.modras)
Failed to create upstream wpt PR due to merge conflicts. This requires fixup from a wpt sync admin.
Flags: needinfo?(krzysztof.modras) → needinfo?(james)
Whiteboard: [webdriver:m15][webdriver:external] → [webdriver:m15][webdriver:external], [wptsync upstream error]

The problem here is that remote/shared/test/browser/browser_Addon.js was not updated for the new error type. Let me actually try to fix that while Krzysztof is away.

Pushed by hskupin@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/9415a653b4b0 [webdriver-bidi] Add support for "webExtension.install" command r=whimboo,webdriver-reviewers
Regressions: 1948158

Backed out for causing WD failures @ webdriver/tests/bidi/web_extension/uninstall/uninstall.py / install/py

Backout link:https://hg.mozilla.org/integration/autoland/rev/6c830e64f486e6b3d1267bbebfb564955bf57f55

Push with failures

Failure log -> TEST-FAIL | /webdriver/tests/bidi/web_extension/install/install.py | test_install_from_path - webdriver.bidi.error.InvalidWebExtensionException: invalid web extension (Could not install Add-on: ERROR_CORRUPT_FILE

Failure log -> TEST-UNEXPECTED-FAIL | /webdriver/tests/bidi/web_extension/uninstall/uninstall.py | test_uninstall - webdriver.bidi.error.InvalidWebExtensionException: invalid web extension (Could not install Add-on: Component returned failure code

tests/web-platform/tests/tools/webdriver/webdriver/bidi/modules/_module.py:76: InvalidWebExtensionException
[task 2025-02-14T03:23:47.771Z] 03:23:47     INFO - 
[task 2025-02-14T03:23:47.771Z] 03:23:47     INFO - TEST-FAIL | /webdriver/tests/bidi/web_extension/install/install.py | test_install_from_path - webdriver.bidi.error.InvalidWebExtensionException: invalid web extension (Could not install Add-on: ERROR_CORRUPT_FILE: The file appears to be corrupt.)
[task 2025-02-14T03:23:47.771Z] 03:23:47     INFO - bidi_session = <webdriver.bidi.client.BidiSession object at 0x7ce23e333880>
[task 2025-02-14T03:23:47.771Z] 03:23:47     INFO - 
[task 2025-02-14T03:23:47.771Z] 03:23:47     INFO -     @pytest.mark.asyncio
[task 2025-02-14T03:23:47.771Z] 03:23:47     INFO -     async def test_install_from_path(bidi_session):
[task 2025-02-14T03:23:47.771Z] 03:23:47     INFO - >       web_extension = await bidi_session.web_extension.install(
[task 2025-02-14T03:23:47.771Z] 03:23:47     INFO -             extensionData={
[task 2025-02-14T03:23:47.771Z] 03:23:47     INFO -                 "type": "path",
[task 2025-02-14T03:23:47.771Z] 03:23:47     INFO -                 "path": get_addon_path("unpacked")
[task 2025-02-14T03:23:47.771Z] 03:23:47     INFO -             }
[task 2025-02-14T03:23:47.771Z] 03:23:47     INFO -         )
[task 2025-02-14T03:23:47.771Z] 03:23:47     INFO - 
[task 2025-02-14T03:23:47.771Z] 03:23:47     INFO - bidi_session = <webdriver.bidi.client.BidiSession object at 0x7ce23e333880>
<...>
 InvalidWebExtensionError@chrome://remote/content/shared/webdriver/Errors.sys.mjs:478:5
[task 2025-02-14T03:22:37.510Z] 03:22:37     INFO - 
[task 2025-02-14T03:22:37.510Z] 03:22:37     INFO - TEST-UNEXPECTED-FAIL | /webdriver/tests/bidi/web_extension/uninstall/uninstall.py | test_uninstall - webdriver.bidi.error.InvalidWebExtensionException: invalid web extension (Could not install Add-on: Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsICryptoHash.updateFromStream])
[task 2025-02-14T03:22:37.511Z] 03:22:37     INFO - bidi_session = <webdriver.bidi.client.BidiSession object at 0x7fcc742fe0a0>
[task 2025-02-14T03:22:37.511Z] 03:22:37     INFO - 
[task 2025-02-14T03:22:37.511Z] 03:22:37     INFO -     @pytest.mark.asyncio
[task 2025-02-14T03:22:37.511Z] 03:22:37     INFO -     async def test_uninstall(bidi_session):
[task 2025-02-14T03:22:37.512Z] 03:22:37     INFO - >       web_extension = await bidi_session.web_extension.install(
[task 2025-02-14T03:22:37.512Z] 03:22:37     INFO -             extensionData={
[task 2025-02-14T03:22:37.513Z] 03:22:37     INFO -                 "type": "base64",
[task 2025-02-14T03:22:37.513Z] 03:22:37     INFO -                 "value": get_base64_for_addon_file("webextension-unsigned.xpi")
[task 2025-02-14T03:22:37.513Z] 03:22:37     INFO -             }
[task 2025-02-14T03:22:37.513Z] 03:22:37     INFO -         )
[task 2025-02-14T03:22:37.513Z] 03:22:37     INFO - 
[task 2025-02-14T03:22:37.514Z] 03:22:37     INFO - bidi_session = <webdriver.bidi.client.BidiSession object at 0x7fcc742fe0a0>
Flags: needinfo?(hskupin)

The failures are due to the patch on bug 1934553. I'll follow-up over there.

Flags: needinfo?(hskupin)
Flags: needinfo?(james)
Pushed by hskupin@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/228c7c8c1786 [webdriver-bidi] Add support for "webExtension.install" command r=whimboo,webdriver-reviewers
Status: NEW → RESOLVED
Closed: 6 months ago
Resolution: --- → FIXED
Target Milestone: --- → 137 Branch
Flags: needinfo?(james)
Flags: needinfo?(aborovova)
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/51359 for changes under testing/web-platform/tests
Whiteboard: [webdriver:m15][webdriver:external], [wptsync upstream error] → [webdriver:m15][webdriver:external], [wptsync upstream]
Flags: needinfo?(james)
Flags: needinfo?(aborovova)
Upstream PR merged by moz-wptsync-bot
Whiteboard: [webdriver:m15][webdriver:external], [wptsync upstream] → [webdriver:m15][webdriver:external], [wptsync upstream][webdriver:relnote]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: