Closed Bug 1934553 Opened 1 year ago Closed 1 year ago

Implement "webExtenstion.uninstall" 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

()

Details

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

Attachments

(2 files)

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

Summary: Implement "webExtenstion.install" command → Implement "webExtenstion.uninstall" command
Severity: -- → S3
Component: Agent → WebDriver BiDi
Priority: -- → P2
Whiteboard: [webdriver:m15]
Points: --- → 3
Assignee: nobody → krzysztof.modras
Priority: P2 → P3
Whiteboard: [webdriver:m15] → [webdriver:m15][webdriver:external]
Points: 3 → ---
Attachment #9461534 - Attachment description: Bug 1934553 - [webdriver-bidi] Add webExtension uninstall command r=whimboo → Bug 1934553 - [webdriver-bidi] Add support for "webExtension.uninstall" command r=whimboo
Pushed by hskupin@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/0194b87bcb08 [webdriver-bidi] Add support for "webExtension.uninstall" command r=whimboo,webdriver-reviewers https://hg.mozilla.org/integration/autoland/rev/6b0eb519cda0 [wdspec] Tests for the installing and uninstalling webExtensions r=whimboo,webdriver-reviewers
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/50683 for changes under testing/web-platform/tests
Whiteboard: [webdriver:m15][webdriver:external] → [webdriver:m15][webdriver:external], [wptsync upstream]

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)
Upstream PR was closed without merging

I fixed it and pushed to lando again.

Flags: needinfo?(krzysztof.modras)
Status: NEW → ASSIGNED
Pushed by hskupin@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/dea8345fdf70 [webdriver-bidi] Add support for "webExtension.uninstall" command r=whimboo,webdriver-reviewers https://hg.mozilla.org/integration/autoland/rev/a3a011153c11 [wdspec] Tests for the installing and uninstalling webExtensions 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)

So there are several issues here:

  1. It's strange that the tests were working before on try because the unsigned XPI is clearly invalid and cannot be unpacked. Maybe something went wrong with the upload to Phabricator? I will re-create the XPI.
  2. When re-creating the XPI I noticed that the unpacked folder still had the Manifest v2 in use. I've updated it to v3.
  3. The signed addon had the Manifest v2 as well, so I went ahead and tried to sign it again via addons.mozilla.org
  4. I wasn't able to do the signing with the current id because we did it initially with an account we do not have access anymore - so a new id needed to be used for the extension.
  5. Also Chrome doesn't support the XPI format but wants to have CRX. That means that we should already account for it and use browser specific webextensions. To be close with the names I suggest to use unpacked/, unsigned.xpi, signed.xpi.
  6. The unsigned XPI we cannot use in a public test because we won't be able to install it - also not via the base64 variant because it would require signature checks to be turned off. We should keep that for our internal tests and we can add tests for it when working on bug 1947678 next.
  7. We should as well use the new addons for the existing webdriver classic internal tests. I will do it in a separate revision / bug.
Flags: needinfo?(hskupin)
Upstream PR was closed without merging
Attachment #9461542 - Attachment description: Bug 1934553 - [wdspec] Tests for the installing and uninstalling webExtensions r=whimboo → Bug 1934553 - [wdspec] Tests for the installing and uninstalling webExtensions r=whimboo.
Pushed by hskupin@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/c8be3f54d352 [webdriver-bidi] Add support for "webExtension.uninstall" command r=whimboo,webdriver-reviewers https://hg.mozilla.org/integration/autoland/rev/1286bc78e41a [wdspec] Tests for the installing and uninstalling webExtensions r=whimboo,webdriver-reviewers,Sasha.
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 137 Branch
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: