servo: Merge #13814 - Fix style unit tests, move parse_longhand macro to parse tests module (from Manishearth:move-macro); r=emilio

We weren't running the style unit tests.

The parse_longhand macro is useful for all tests.

Source-Repo: https://github.com/servo/servo
Source-Revision: a2e42fa13bd9ac0244ea33d4746fb395a7f87f5e
This commit is contained in:
Manish Goregaokar 2016-10-18 11:03:55 -05:00
Родитель 0f32029dee
Коммит cd3420a10b
4 изменённых файлов: 13 добавлений и 10 удалений

Просмотреть файл

@ -237,7 +237,9 @@ class MachCommands(CommandBase):
if features:
args += ["--features", "%s" % ' '.join(features)]
return call(args, env=env, cwd=self.servo_crate())
err = call(args, env=env, cwd=self.servo_crate())
if err is not 0:
return err
# Run style tests with the testing feature
if has_style:

Просмотреть файл

@ -11,14 +11,6 @@ use style::properties::shorthands::mask;
use style::stylesheets::Origin;
use url::Url;
macro_rules! parse_longhand {
($name:ident, $s:expr) => {{
let url = Url::parse("http://localhost").unwrap();
let context = ParserContext::new(Origin::Author, &url, Box::new(CSSErrorReporterTest));
$name::parse(&context, &mut Parser::new($s)).unwrap()
}};
}
#[test]
fn mask_shorthand_should_parse_all_available_properties_when_specified() {
let url = Url::parse("http://localhost").unwrap();

Просмотреть файл

@ -32,6 +32,14 @@ macro_rules! assert_roundtrip {
}
macro_rules! parse_longhand {
($name:ident, $s:expr) => {{
let url = Url::parse("http://localhost").unwrap();
let context = ParserContext::new(Origin::Author, &url, Box::new(CSSErrorReporterTest));
$name::parse(&context, &mut Parser::new($s)).unwrap()
}};
}
mod basic_shape;
mod mask;
mod position;

Просмотреть файл

@ -421,7 +421,8 @@ mod shorthand_serialization {
let position = DeclaredValue::Value(ListStylePosition::inside);
let image = DeclaredValue::Value(ListStyleImage::Url(
Url::parse("http://servo/test.png").unwrap()
Url::parse("http://servo/test.png").unwrap(),
UrlExtraData {},
));
let style_type = DeclaredValue::Value(ListStyleType::disc);