Closed Bug 1573254 Opened 5 years ago Closed 5 years ago

Support remote windows in SpecialPowers.snapshotWindow

Categories

(Testing :: Mochitest, task)

Version 3
task
Not set
normal

Tracking

(Fission Milestone:M4, firefox70 fixed)

RESOLVED FIXED
mozilla70
Fission Milestone M4
Tracking Status
firefox70 --- fixed

People

(Reporter: kmag, Assigned: kmag)

References

(Blocks 1 open bug)

Details

Attachments

(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.

https://hg.mozilla.org/integration/mozilla-inbound/rev/c3db0f8fbc5b2ac742da75e8295052d5d9510306
Bug 1573254: Part 1 - Support remote windows in SpecialPowers.snapshotWindow. r=mccr8

https://hg.mozilla.org/integration/mozilla-inbound/rev/4b826e607ca87939b656b62836721973c67dac71
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.

Attachment

General

Created:
Updated:
Size: