diff --git a/widget/tests/test_textScaleFactor_system_font.html b/widget/tests/test_textScaleFactor_system_font.html index 68a879b0b1dd..bd2b55fbb624 100644 --- a/widget/tests/test_textScaleFactor_system_font.html +++ b/widget/tests/test_textScaleFactor_system_font.html @@ -59,10 +59,7 @@ add_task(async () => { // MOZ_HEADLESS is set in content processes with GTK regardless of the // headless state of the parent process. Check the parent state. const headless = await SpecialPowers.spawnChrome([], function get_headless() { - const env = Cc["@mozilla.org/process/environment;1"].getService( - Ci.nsIEnvironment - ); - return env.get("MOZ_HEADLESS"); + return Services.env.get("MOZ_HEADLESS"); }); // LookAndFeel::TextScaleFactor::FloatID is implemented only for WINNT and // GTK. ui.textScaleFactor happens to scale CSS pixels on other platforms