Closed Bug 1700482 Opened 3 years ago Closed 9 months ago

Re-enable failing xpcshell tests on Android and run them with out-of-process extensions enabled

Categories

(WebExtensions :: Android, task, P3)

task

Tracking

(firefox118 fixed)

RESOLVED FIXED
118 Branch
Tracking Status
firefox118 --- fixed

People

(Reporter: agi, Assigned: robwu)

References

Details

(Whiteboard: [addons-jira])

Attachments

(4 files)

After running xpcshell in a android service, a few tests fail. It's not really surprising given that tests used to run in non-e10s mode on Android.

This bug is about re-enabling them. A lot fail with:

[@ mozilla::net::ParentProcessDocumentChannel::RedirectToRealChannel(nsTArray<mozilla::ipc::Endpoint<mozilla::extensions::PStreamFilterParent> >&&, unsigned int, unsigned int)]

See Also: → 1384923

The following tests load remote content from an extension page and are affected by bug 1724099:

  • test_ext_background_api_injection.js
  • test_ext_cookieBehaviors.js
  • test_ext_contentscript_in_background.js
  • test_ext_same_site_redirects.js

Out of the tests from comment 1, the following may be failing for a different reason:

  • test_ext_startup_request_handler.js
  • test_ext_userScripts.js
  • test_ext_userScripts_telemetry.js
Depends on: 1724099

Is this bug a duplicate of bug 1680132?

See Also: → 1680132

They are not duplicates. These tests were disabled independently of each other, the source code contains references to both bugs:

Blocks: 1680132
See Also: 1680132

Some more context, so that it is obvious what the difference is between this bug and bug 1680132.

First of all, through all of this, tests run with out-of-process extensions disabled.

  • Bug 1680132: filed after bug 1678068, which re-enabled tests in Firefox 85 that have been disabled since Firefox 68. Firefox 68 is effectively Fennec (in fact ESR68 branch was Fennec until Fenix was ready). The failures are mainly due to functional losses between Fennec and Fenix, including but not limited to:

    • downloads API broken (bug 1538348).
    • lack of support for new storage backend (bug 1637465).
    • other bitrot: random changes between Firefox 68 and Firefox 85 that broke the test (e.g. bug 1723523).
    • Note: re-enabling all of them is not trivial.
  • Bug 1700482: filed after bug 1567341 (Firefox 89), which started to run xpcshell tests in a more realistic environment in the context of GeckoView.

    • With this change, e10s is finally enabled. And with that, checks that were previously skipped because everything ran in one process started to run, such as bug 1724099 that is responsible for the test failures mentioned in comment 2.

The next step is towards running tests with out-of-process extensions enabled. When I run the tests in xpcshell-remote.ini locally, it looks like there are no test failures. Furthermore, during my investigation in the test failures in connection to this bug, it is apparent that the tests disabled at the second time (associated with this bug) are passing.

So, in this bug I will focus on re-enabling tests and running all other tests with out-of-process extensions enabled.

Assignee: nobody → rob
Status: NEW → ASSIGNED
Summary: Re-enable failing xpcshell tests on Android → Re-enable failing xpcshell tests on Android and run them with out-of-process extensions enabled
Whiteboard: [addons-jira]

Five tests were disabled completely despite them running mostly fine
when extensions.webextensions.remote is enabled. Since these tests are
listed twice (xpcshell-common.ini is included by xpcshell.ini and
xpcshell-remote.ini), it's either all or nothing.

This patch fixes the underlying failure (documented in bug 1724099), and
annotates some other unrelated failures.

test_ext_startup_request_handler.js fails with
--tag=in-process-extensions (which is only enabled on Android because
out-of-process extensions are enabled by default on desktop), because it
loads an extension page under the assumption that it works.

ExtensionTestUtils.fetch uses ExtensionTestUtils.loadContentPage under
the hood, which should be passed an "extension" parameter when an
extension URL is being loaded. Without that, remote defaults to the e10s
setting, which is always true in practice. But when out-of-process
extensions are disabled, the moz-extension:-URL cannot be loaded
remotely, which results in the test getting stuck.

This patch fixes the issue by using loadContentPage directly and passing
the extension parameter.

test_ext_userScripts.js was failing on Android because the
"webextension-optional-permission-prompt" notification triggers the
"GeckoView:WebExtension:OptionalPrompt" message. While this message is
handled in GVE, TestRunnerActivity and Fenix, that is not the case for
XpcshellTestRunnerService. This results in an uncaught promise
rejection, thus a test failure.

Since the test doesn't really care about the underlying prompting
implementation, disable the prompt logic with the relevant pref.

Depends on: 1845352
Pushed by rob@robwu.nl:
https://hg.mozilla.org/integration/autoland/rev/a66808dc189e
Run xpcshell tests with out-of-process extensions on Android r=rpl
https://hg.mozilla.org/integration/autoland/rev/80b8b7daaa90
Fix and re-enable xpcshell tests that failed due to parent load r=rpl
https://hg.mozilla.org/integration/autoland/rev/9ba400d39f64
Fix and re-enable test_ext_startup_request_handler.js r=willdurand
https://hg.mozilla.org/integration/autoland/rev/e499148c97a0
Fix and re-enable test_ext_userScripts.js on Android r=willdurand
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: