Closed Bug 1771012 Opened 9 months ago Closed 5 months ago

Add a hook for ServiceWorkerDelegate to allow testing code from Gecko to open a new tab

Categories

(GeckoView :: General, enhancement, P1)

Unspecified
All
enhancement

Tracking

(firefox103 wontfix, firefox104 wontfix, firefox105 wontfix, firefox106 fixed)

RESOLVED FIXED
106 Branch
Tracking Status
firefox103 --- wontfix
firefox104 --- wontfix
firefox105 --- wontfix
firefox106 --- fixed

People

(Reporter: whimboo, Assigned: olivia)

References

Details

(Whiteboard: [geckoview:m104] [geckoview:m105] [geckoview:m106])

Attachments

(1 file)

Over on bug 1506782 we need a way to open a new tab in all the GeckoView applications for our remote protocols supporting WebDriver (Marionette and Remote Agent).

As discussed with Agi this could be done via a specific WebExtension or by allowing various testing code to share a ServiceWorkerDelegate. The latter would be more ergonomic given that it would automatically support all the different applications, and won't require an installation of the WebExtension delegate in each of these.

The ServiceWorkerDelegate is implemented in C++ and as such the requested code would need some Javascript plumbing similar to this code, but with a different type like GeckoTest:NewTab.

Then it would have to be listened for here:
https://searchfox.org/mozilla-central/source/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoRuntime.java#308

And do something like this:
https://searchfox.org/mozilla-central/rev/c6620104602decf1af7c6a9f78692426db6a5da2/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/WebExtensionController.java#1012-1045

With that we might also get rid of the test-runner-support web-extension and delegate, and let it re-use the same service worker delegate.

Agi, please update the summary and add more details if something is wrong or missing.

Thanks a lot!

Flags: needinfo?(agi)

Your summary looks pretty good to me! If you or anybody have specific questions feel free to ni me.

Flags: needinfo?(agi)

Thanks Agi. Do you think that the GeckoView team could help out with getting this request implemented? We would appreciate that. Thanks!

Flags: needinfo?(agi)

(Agi says Henrik says) about one-third of WebDriver tests can't run on Android because of this bug.

Severity: -- → S3
Priority: -- → P2
Whiteboard: [geckoview:m104?]
Flags: needinfo?(agi)

Olivia said she will work on this bug for 104.

Assignee: nobody → ohall
Priority: P2 → P1
Whiteboard: [geckoview:m104?] → [geckoview:m104]

105

Olivia says this bug is now unblocked.

Whiteboard: [geckoview:m104] → [geckoview:m104] [geckoview:m105]

Adds event "GeckoView:Test:NewTab”, which allow testers to create tabs.

GeckoViewTestUtils.jsm sends the event from the JavaScript side for
use in testing.

A ServiceWorkerDelegate is required to be set for the
GeckoRuntime to use these events, which was setup on the test
runner.

Attachment #9287266 - Attachment description: WIP: Bug 1771012 - GeckoView Open Tabs Test Utility → Bug 1771012 - GeckoView Open Tabs Test Utility
Whiteboard: [geckoview:m104] [geckoview:m105] → [geckoview:m104] [geckoview:m105] [geckoview:m106]
Pushed by ohall@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/842f23326e60
GeckoView Open Tabs Test Utility r=geckoview-reviewers,owlish
Status: NEW → RESOLVED
Closed: 5 months ago
Resolution: --- → FIXED
Target Milestone: --- → 106 Branch
You need to log in before you can comment on or make changes to this bug.