Files
sousa-gecko/mobile/shared/modules/test
Rob Wu 1c7e3812c1 Bug 2040023 - Fix AppTestDelegate.openNewForegroundTab and use it in test_ext_tabs_captureTab.html r=willdurand,geckoview-reviewers,ohall
Top-level navigations to data:-URL will soon only be supported when
triggered with the system principal, not via window.open().
This replaces window.open() in test_ext_tabs_captureTab.html with
AppTestDelegate.openNewForegroundTab, and updates that method to
use the system principal like desktop (otherwise it would also fail for
the same reason that window.open would fail).

This fix uncovered a pre-existing issue in TestRunnerActivity: when
AppTestDelegate.openNewForegroundTab (or browser.tabs.create) creates
a new session, it does not have a surface, which causes anything that
depends on one to fail, including the `tabs.captureVisibleTab` method
in this test (https://bugzilla.mozilla.org/show_bug.cgi?id=2040023#c1).
That test-only issue was fixed by adding a surface as needed.

Differential Revision: https://phabricator.services.mozilla.com/D300889
2026-05-18 14:34:55 +00:00
..
…