Closed Bug 1573254 Opened 3 months ago Closed 3 months ago

Support remote windows in SpecialPowers.snapshotWindow


(Testing :: Mochitest, task)

Version 3
Not set


(Fission Milestone:M4, firefox70 fixed)

Fission Milestone M4
Tracking Status
firefox70 --- fixed


(Reporter: kmag, Assigned: kmag)


(Blocks 1 open bug)



(2 files)

A lot of the tests that currently use the snapshotWindow API do so with cross-origin windows. Under Fission, these windows are also cross-process, and cannot be captured with the current API.

The most straightforward way to handle these windows is to take the snapshot in the process that owns the window, and return the ImageData. This would make the API asynchronous, and require that it return a promise.

Unfortunately, a lot of the existing callers are timing-sensitive, and can't easily be migrated to use an async API. So my plan is to simply return a synchronous snapshot when given an in-process window, and to return a promise in all other cases.

Ideally we'd just have separate sync and async APIs, but given the number of existing callers, I don't think it's worth the effort to migrate them all.

This fixes several tests which snapshot remote windows under Fission. It also
changes some other arbitrary tests that don't use remote windows, which I
changed before I gave up on having an always-async API.
Bug 1573254: Part 1 - Support remote windows in SpecialPowers.snapshotWindow. r=mccr8
Bug 1573254: Part 2 - Update tests to await snapshotWindow when necessary. r=mccr8
Regressions: 1574137
Fission Milestone: --- → M4
You need to log in before you can comment on or make changes to this bug.