Refactor util::prefs operations to be methods on static struct.

This commit is contained in:
Corey Farwell 2016-07-02 13:51:17 -04:00
parent 307844a8c1
commit 22928f50ac
30 changed files with 166 additions and 162 deletions

View file

@ -30,8 +30,8 @@ fn test_viewport_rule<F>(css: &str,
callback: F)
where F: Fn(&Vec<ViewportDescriptorDeclaration>, &str)
{
::util::prefs::set_pref("layout.viewport.enabled",
::util::prefs::PrefValue::Boolean(true));
::util::prefs::PREFS.set("layout.viewport.enabled",
::util::prefs::PrefValue::Boolean(true));
let stylesheet = stylesheet!(css, Author, Box::new(CSSErrorReporterTest));
let mut rule_count = 0;
for rule in stylesheet.effective_rules(&device).viewport() {
@ -245,8 +245,8 @@ fn cascading_within_viewport_rule() {
#[test]
fn multiple_stylesheets_cascading() {
::util::prefs::set_pref("layout.viewport.enabled",
::util::prefs::PrefValue::Boolean(true));
::util::prefs::PREFS.set("layout.viewport.enabled",
::util::prefs::PrefValue::Boolean(true));
let device = Device::new(MediaType::Screen, Size2D::typed(800., 600.));
let error_reporter = CSSErrorReporterTest;
let stylesheets = vec![