Fix servo build.

This commit is contained in:
Emilio Cobos Álvarez 2018-04-25 18:50:48 +02:00
parent 16ca8de6df
commit 54b444992d
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
13 changed files with 148 additions and 143 deletions

View file

@ -16,8 +16,10 @@ fn test_font_template_descriptor() {
use std::fs::File;
use std::io::prelude::*;
use std::path::PathBuf;
use style::computed_values::font_stretch::T as FontStretch;
use style::values::computed::Percentage;
use style::values::computed::font::FontWeight;
use style::values::generics::NonNegative;
use style::values::generics::font::FontStyle;
fn descriptor(filename: &str) -> FontTemplateDescriptor {
let mut path: PathBuf = [
@ -43,25 +45,25 @@ fn test_font_template_descriptor() {
assert_eq!(descriptor("DejaVuSans"), FontTemplateDescriptor {
weight: FontWeight::normal(),
stretch: FontStretch::Normal,
italic: false,
stretch: NonNegative(Percentage(1.)),
style: FontStyle::Normal,
});
assert_eq!(descriptor("DejaVuSans-Bold"), FontTemplateDescriptor {
weight: FontWeight::bold(),
stretch: FontStretch::Normal,
italic: false,
stretch: NonNegative(Percentage(1.)),
style: FontStyle::Normal,
});
assert_eq!(descriptor("DejaVuSans-Oblique"), FontTemplateDescriptor {
weight: FontWeight::normal(),
stretch: FontStretch::Normal,
italic: true,
stretch: NonNegative(Percentage(1.)),
style: FontStyle::Italic,
});
assert_eq!(descriptor("DejaVuSansCondensed-BoldOblique"), FontTemplateDescriptor {
weight: FontWeight::bold(),
stretch: FontStretch::SemiCondensed,
italic: true,
stretch: NonNegative(Percentage(0.875)),
style: FontStyle::Italic,
});
}