Closed Bug 1766852 Opened 3 years ago Closed 3 years ago

Enable `test_ext_scripting_permissions.html` test file for Android and Linux/e10s

Categories

(WebExtensions :: General, task, P2)

task
Points:
1

Tracking

(firefox102 fixed)

RESOLVED FIXED
102 Branch
Tracking Status
firefox102 --- fixed

People

(Reporter: willdurand, Assigned: robwu)

References

Details

(Whiteboard: [addons-jira])

Attachments

(1 file)

Bug 1760451 introduced a new test file that is currently disabled for Android because it hangs (similar symptoms that led us to discover Bug 1766822). We should re-enable this test on Android.

Update (2022-05-11): the test file has been disabled for linux without fission (os == 'linux' && !fission).

Summary: Enable `test_ext_scripting_permissions.html` test file for Android → Enable `test_ext_scripting_permissions.html` test file for Android and Linux/e10s

This test is consistently failing locally for me on macOS, artifact OPT build. I have been trying to get this test to pass with different versions of m-c over the past 3 weeks, but it fails consistently. Command is:

./mach test toolkit/components/extensions/test/mochitest/test_ext_scripting_permissions.html --tag=remote-webextensions --log-mach-verbose

Even with the patch from bug 1766822, the test gets stuck after opening https://example.org/?2. Presumably because the content script has not run.

One of the theories that I've considered is that permissions.request() resolves before the actual permission update has been propagated to the content processes. If that's the case, then doing roundtrips with the content process should get the test to pass. But even with the following patch the test continues to be stuck:

diff --cc toolkit/components/extensions/parent/ext-permissions.js
index 69bbfc92d4023,69bbfc92d4023..fe5f7c79f0d7f
--- a/toolkit/components/extensions/parent/ext-permissions.js
+++ b/toolkit/components/extensions/parent/ext-permissions.js
@@@ -73,6 -73,6 +73,11 @@@ this.permissions = class extends Extens
    getAPI(context) {
      let { extension } = context;

++    async function pingpong() {
++      await extension.broadcast("Extension:UpdatePermissions", {id: "invalid"});
++      await extension.broadcast("Extension:UpdatePermissions", {id: "invalid"});
++    }
++
      return {
        permissions: {
          async request(perms) {
@@@ -134,6 -134,6 +139,7 @@@
            }

            await ExtensionPermissions.add(extension.id, perms, extension);
++          await pingpong();
            return true;
          },

@@@ -169,6 -169,6 +175,7 @@@
              permissions,
              extension
            );
++          await pingpong();
            return true;
          },

The test passes on CI.
Shane tried to run the test locally (even with --verify), but he is not able to reproduce the failure on macOS.
Tom confirmed that the test passes on Windows.

With the (updated) patch from bug 1766822, the test passes locally. I've attached a patch to re-enable the test.

Assignee: wdurand → rob
Pushed by rob@robwu.nl: https://hg.mozilla.org/integration/autoland/rev/857a3d3982ce Re-enable test_ext_scripting_permissions.html on Android and Linux r=willdurand
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 102 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: