Open Bug 1756055 Opened 2 years ago Updated 2 years ago

Can we do away with do_get_profile and Services.fog.initializeFOG in xpcshell?

Categories

(Toolkit :: Telemetry, task)

task

Tracking

()

People

(Reporter: chutten, Unassigned)

References

(Blocks 1 open bug)

Details

(Whiteboard: [telemetry:fog:m?])

It sucks that FOG instrumentation tests all need the same front matter:

// FOG needs a profile directory to store its info.
do_get_profile();
// FOG needs to be initialized exactly once.
Services.fog.initializeFOG();

Is there anything we can do about this?

An idea: the only part of do_get_profile() that FOG needs is ProfD. Maybe we can do that part cheaply before every test file in head.js? Like maybe here? And then, thereafter, is initializeFOG cheap enough for us to run unconditionally? Is there a mode of initialization we could run unconditionally?

If not, is there a clever JS thing we could do to intercept test methods and ensure FOG is init the first time they're called?

Maybe we can make this nice.

You need to log in before you can comment on or make changes to this bug.