mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1241557 - Don't try to set prefs directly. r=wchen
This commit is contained in:
parent
85bb824b0d
commit
303f79daed
@ -19,24 +19,17 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=513439
|
||||
|
||||
/** Test for Bug 513439 **/
|
||||
|
||||
var prefService = SpecialPowers.Cc["@mozilla.org/preferences-service;1"]
|
||||
.getService(SpecialPowers.Ci.nsIPrefService);
|
||||
var layoutCSSBranch = prefService.getBranch("layout.css.");
|
||||
var oldVal = layoutCSSBranch.getCharPref("devPixelsPerPx");
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
try {
|
||||
var domWindowUtils = SpecialPowers.DOMWindowUtils;
|
||||
var devPxPerCSSPx = domWindowUtils.screenPixelsPerCSSPixel;
|
||||
|
||||
layoutCSSBranch.setCharPref("devPixelsPerPx", "2");
|
||||
var domWindowUtils = SpecialPowers.DOMWindowUtils;
|
||||
SpecialPowers.pushPrefEnv({set: [["layout.css.devPixelsPerPx", "2"]]}, () => {
|
||||
is(domWindowUtils.screenPixelsPerCSSPixel, 2, "devPixelsPerPx wasn't set correctly");
|
||||
|
||||
layoutCSSBranch.setCharPref("devPixelsPerPx", "1.5");
|
||||
SpecialPowers.pushPrefEnv({set: [["layout.css.devPixelsPerPx", "1.5"]]}, () => {
|
||||
is(domWindowUtils.screenPixelsPerCSSPixel, 1.5, "devPixelsPerPx wasn't set correctly");
|
||||
|
||||
} finally {
|
||||
layoutCSSBranch.setCharPref("devPixelsPerPx", oldVal);
|
||||
}
|
||||
SimpleTest.finish();
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
|
Loading…
Reference in New Issue
Block a user