mirror of
https://github.com/servo/servo.git
synced 2025-09-10 23:18:20 +01:00
Auto merge of #16655 - servo:jdm-patch-1, r=emilio
Fix broken unit tests These are tests that only get run on TravisCI, apparently, so they were broken bybe0139ff3c
and32c624e585
without anybody noticing. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/16655) <!-- Reviewable:end -->
This commit is contained in:
commit
3905b5af18
6 changed files with 53 additions and 28 deletions
|
@ -27,6 +27,7 @@ mod logical_geometry;
|
|||
mod media_queries;
|
||||
mod parsing;
|
||||
mod properties;
|
||||
mod restyle_hints;
|
||||
mod rule_tree;
|
||||
mod size_of;
|
||||
mod str;
|
||||
|
|
31
tests/unit/style/restyle_hints.rs
Normal file
31
tests/unit/style/restyle_hints.rs
Normal file
|
@ -0,0 +1,31 @@
|
|||
/* 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 http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#[test]
|
||||
fn smoke_restyle_hints() {
|
||||
use cssparser::Parser;
|
||||
use selectors::parser::SelectorList;
|
||||
use style::restyle_hints::{DependencySet, RESTYLE_LATER_SIBLINGS};
|
||||
use style::selector_parser::SelectorParser;
|
||||
use style::stylesheets::{Origin, Namespaces};
|
||||
let namespaces = Namespaces::default();
|
||||
let parser = SelectorParser {
|
||||
stylesheet_origin: Origin::Author,
|
||||
namespaces: &namespaces,
|
||||
};
|
||||
|
||||
let mut dependencies = DependencySet::new();
|
||||
|
||||
let mut p = Parser::new(":not(:active) ~ label");
|
||||
let selectors = SelectorList::parse(&parser, &mut p).unwrap();
|
||||
assert_eq!((selectors.0).len(), 1);
|
||||
|
||||
let selector = (selectors.0).first().unwrap();
|
||||
dependencies.note_selector(selector);
|
||||
assert_eq!(dependencies.len(), 1);
|
||||
let state_deps = dependencies.get_state_deps();
|
||||
assert_eq!(state_deps.len(), 1);
|
||||
assert!(!state_deps[0].sensitivities.states.is_empty());
|
||||
assert!(state_deps[0].hint.contains(RESTYLE_LATER_SIBLINGS));
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue