diff options
-rw-r--r-- | tests/unit/style/animated_properties.rs | 12 | ||||
-rw-r--r-- | tests/unit/style/parsing/animation.rs | 43 | ||||
-rw-r--r-- | tests/unit/style/parsing/mod.rs | 1 | ||||
-rw-r--r-- | tests/unit/style/stylesheets.rs | 16 |
4 files changed, 8 insertions, 64 deletions
diff --git a/tests/unit/style/animated_properties.rs b/tests/unit/style/animated_properties.rs index dd233f01b89..fd03a1904e8 100644 --- a/tests/unit/style/animated_properties.rs +++ b/tests/unit/style/animated_properties.rs @@ -4,7 +4,6 @@ use cssparser::RGBA; use style::values::animated::{Animate, Procedure, ToAnimatedValue}; -use style::values::generics::transform::{Transform, TransformOperation}; fn interpolate_rgba(from: RGBA, to: RGBA, progress: f64) -> RGBA { let from = from.to_animated_value(); @@ -81,14 +80,3 @@ fn test_rgba_color_interepolation_out_of_range_clamped_2() { RGBA::from_floats(0.0, 0.0, 0.0, 0.0) ); } - -#[test] -fn test_transform_interpolation_on_scale() { - let from = Transform(vec![TransformOperation::Scale3D(1.0, 2.0, 1.0)]); - let to = Transform(vec![TransformOperation::Scale3D(2.0, 4.0, 2.0)]); - assert_eq!( - from.animate(&to, Procedure::Interpolate { progress: 0.5 }) - .unwrap(), - Transform(vec![TransformOperation::Scale3D(1.5, 3.0, 1.5)]) - ); -} diff --git a/tests/unit/style/parsing/animation.rs b/tests/unit/style/parsing/animation.rs deleted file mode 100644 index f67d77e9afd..00000000000 --- a/tests/unit/style/parsing/animation.rs +++ /dev/null @@ -1,43 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ - -use crate::parsing::parse; -use servo_atoms::Atom; -use style::parser::Parse; -use style::properties::longhands::animation_name; -use style::values::specified::AnimationIterationCount; -use style::values::{CustomIdent, KeyframesName}; -use style_traits::ToCss; - -#[test] -fn test_animation_name() { - use self::animation_name::single_value::SpecifiedValue as SingleValue; - let other_name = Atom::from("other-name"); - assert_eq!( - parse_longhand!(animation_name, "none"), - animation_name::SpecifiedValue(vec![SingleValue(None)]) - ); - assert_eq!( - parse_longhand!( - animation_name, - "other-name, none, 'other-name', \"other-name\"" - ), - animation_name::SpecifiedValue(vec![ - SingleValue(Some(KeyframesName::Ident(CustomIdent(other_name.clone())))), - SingleValue(None), - SingleValue(Some(KeyframesName::QuotedString(other_name.clone()))), - SingleValue(Some(KeyframesName::QuotedString(other_name.clone()))) - ]) - ); -} - -#[test] -fn test_animation_iteration() { - assert_roundtrip_with_context!(AnimationIterationCount::parse, "0", "0"); - assert_roundtrip_with_context!(AnimationIterationCount::parse, "0.1", "0.1"); - assert_roundtrip_with_context!(AnimationIterationCount::parse, "infinite", "infinite"); - - // Negative numbers are invalid - assert!(parse(AnimationIterationCount::parse, "-1").is_err()); -} diff --git a/tests/unit/style/parsing/mod.rs b/tests/unit/style/parsing/mod.rs index 095f74c9603..aff8d1fc47c 100644 --- a/tests/unit/style/parsing/mod.rs +++ b/tests/unit/style/parsing/mod.rs @@ -133,7 +133,6 @@ macro_rules! parse_longhand { }; } -mod animation; mod background; mod border; mod box_; diff --git a/tests/unit/style/stylesheets.rs b/tests/unit/style/stylesheets.rs index fe8a7b84269..c6b02f37eda 100644 --- a/tests/unit/style/stylesheets.rs +++ b/tests/unit/style/stylesheets.rs @@ -194,7 +194,7 @@ fn test_parse_stylesheet() { PropertyDeclaration::BackgroundPositionX( longhands::background_position_x::SpecifiedValue(vec![ PositionComponent::zero(), - ]), + ].into()), ), Importance::Normal, ), @@ -202,7 +202,7 @@ fn test_parse_stylesheet() { PropertyDeclaration::BackgroundPositionY( longhands::background_position_y::SpecifiedValue(vec![ PositionComponent::zero(), - ]), + ].into()), ), Importance::Normal, ), @@ -210,7 +210,7 @@ fn test_parse_stylesheet() { PropertyDeclaration::BackgroundRepeat( longhands::background_repeat::SpecifiedValue( vec![longhands::background_repeat::single_value - ::get_initial_specified_value()], + ::get_initial_specified_value()].into(), ), ), Importance::Normal, @@ -219,7 +219,7 @@ fn test_parse_stylesheet() { PropertyDeclaration::BackgroundAttachment( longhands::background_attachment::SpecifiedValue( vec![longhands::background_attachment::single_value - ::get_initial_specified_value()], + ::get_initial_specified_value()].into(), ), ), Importance::Normal, @@ -228,7 +228,7 @@ fn test_parse_stylesheet() { PropertyDeclaration::BackgroundImage( longhands::background_image::SpecifiedValue( vec![longhands::background_image::single_value - ::get_initial_specified_value()], + ::get_initial_specified_value()].into(), ), ), Importance::Normal, @@ -237,7 +237,7 @@ fn test_parse_stylesheet() { PropertyDeclaration::BackgroundSize( longhands::background_size::SpecifiedValue( vec![longhands::background_size::single_value - ::get_initial_specified_value()], + ::get_initial_specified_value()].into(), ), ), Importance::Normal, @@ -246,7 +246,7 @@ fn test_parse_stylesheet() { PropertyDeclaration::BackgroundOrigin( longhands::background_origin::SpecifiedValue( vec![longhands::background_origin::single_value - ::get_initial_specified_value()], + ::get_initial_specified_value()].into(), ), ), Importance::Normal, @@ -255,7 +255,7 @@ fn test_parse_stylesheet() { PropertyDeclaration::BackgroundClip( longhands::background_clip::SpecifiedValue( vec![longhands::background_clip::single_value - ::get_initial_specified_value()], + ::get_initial_specified_value()].into(), ), ), Importance::Normal, |