Closed Bug 1532795 Opened 6 years ago Closed 5 years ago

Support ContentTask over JS Window Actors for testing

Categories

(Core :: IPC, task, P2)

task

Tracking

()

RESOLVED FIXED
mozilla69
Fission Milestone M4
Tracking Status
firefox69 --- fixed

People

(Reporter: nika, Assigned: kmag)

References

Details

Attachments

(5 files, 1 obsolete file)

ContentTask is pretty handy for running code in content processes for tests. Unfortunately, it doesn't provide an easy mechanism for sending messages into out-of-process subframes, or to specific processes with Window Globals.

It would be nice to make ContentTask more generic and capable of being sent over JS Window Actors.

I think this could be especially useful for writing tests to be fission compatible.

I imagine this could be possible by making a specific JS Window Actor which handles running the scripts, similar to the existing implementation, and then using some common logic to pick a BrowsingContext based on the object passed in (e.g. subframe for browser, iframe, frameloader. specific for a WindowGlobalParent), sending a message to the parent process (if not already in it), and then bouncing the message back into the correct content process.

Depends on: 1541173
No longer depends on: 1531163
Blocks: 1541173
No longer blocks: 1467212
Depends on: 1531163
No longer depends on: 1541173
Fission Milestone: M2 → M3
Fission Milestone: M3 → M4
Type: enhancement → task
Assignee: nobody → kmaglione+bmo

With out-of-process iframes, we'll need similar functionality to the
ContentTask helpers that can be used in any process, with any type of frame.

Using ContentTask directly in unprivileged contexts will, I think, be a bit
too combersome given how often it's needed, so this patch adds an API directly
to SpecialPowers instead.

The environment provided to the task is currently pretty basic, and doesn't
provide the assertion helpers currently available to ContentTask tasks, but it
can grow as we find it necessary.

Attachment #9072227 - Attachment description: Bug 1532795: Implement basic SpecialPowers.spawn as a replacement for ContentTask. r=nika → Bug 1532795: Part 2 - Implement basic SpecialPowers.spawn as a replacement for ContentTask. r=nika
Attachment #9072735 - Attachment is obsolete: true
Blocks: 1561150

ni? :mccr8 - noticed that Part 4 here adds a helper similar to the sort of thing we'd be doing in bug 1559478. Might be cleaner to implement it that way, but the getter is also an option.

Flags: needinfo?(continuation)
See Also: → 1559478

Ok, thanks. I'll take a look when I get around to bug 1559478.

Flags: needinfo?(continuation)
https://hg.mozilla.org/integration/mozilla-inbound/rev/1471732eca80f6fa44ae50b39c0317965cd29671 Bug 1532795: Part 1 - Support sending BrowsingContexts via structured clone. r=nika https://hg.mozilla.org/integration/mozilla-inbound/rev/8a3d311c7fac75b5902f2fa9dc651137a499fc18 Bug 1532795: Part 2 - Implement basic SpecialPowers.spawn as a replacement for ContentTask. r=nika https://hg.mozilla.org/integration/mozilla-inbound/rev/fbbe113aeef2f44741248ef15be66562e66adf6c Bug 1532795: Part 3 - Update random test to use SpecialPowers.spawn for cross-process iframe access. r=nika https://hg.mozilla.org/integration/mozilla-inbound/rev/119caddcb0660754f9bce5e7153bfc92dc211d57 Bug 1532795: Part 4 - Add helper to get BrowsingContext from WindowProxy. r=nika https://hg.mozilla.org/integration/mozilla-inbound/rev/d5415970da5fd83eb870b397b8db7fdf6c57ad23 Bug 1532795: Part 5 - Support SpecialPowers.spawn on WindowProxy objects. r=nika
Pushed by maglione.k@gmail.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/cf359a8ec753 Part 1 - Support sending BrowsingContexts via structured clone. r=nika https://hg.mozilla.org/integration/mozilla-inbound/rev/c873f0eb94be Part 2 - Implement basic SpecialPowers.spawn as a replacement for ContentTask. r=nika https://hg.mozilla.org/integration/mozilla-inbound/rev/a7f093fbef06 Part 3 - Update random test to use SpecialPowers.spawn for cross-process iframe access. r=nika https://hg.mozilla.org/integration/mozilla-inbound/rev/23e90c6fec2b Part 4 - Add helper to get BrowsingContext from WindowProxy. r=nika https://hg.mozilla.org/integration/mozilla-inbound/rev/3fe4d4942fd2 Part 5 - Support SpecialPowers.spawn on WindowProxy objects. r=nika
Status: RESOLVED → REOPENED
Flags: needinfo?(kmaglione+bmo)
Resolution: FIXED → ---
Target Milestone: mozilla69 → ---
Status: REOPENED → RESOLVED
Closed: 5 years ago5 years ago
Flags: needinfo?(kmaglione+bmo)
Resolution: --- → FIXED
Target Milestone: --- → mozilla69
See Also: → 1743857
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: