mirror of
https://github.com/servo/servo.git
synced 2025-08-25 23:28:21 +01:00
Move selectors size_of tests to Stylo tests
This commit is contained in:
parent
5d920df460
commit
7d1dc7286a
8 changed files with 8 additions and 124 deletions
|
@ -22,11 +22,7 @@ log = {version = "0.3.5", features = ["release_max_level_info"]}
|
|||
malloc_size_of = {path = "../../components/malloc_size_of"}
|
||||
nsstring = {path = "../../support/gecko/nsstring"}
|
||||
parking_lot = "0.4"
|
||||
# Turn on gecko_like_types because of so that crates which use this
|
||||
# crate and also dev-depend on stylo_tests get reasonable behavior
|
||||
# during rebuilds. See https://github.com/rust-lang/cargo/issues/3923
|
||||
# for the cargo problem behind this.
|
||||
selectors = {path = "../../components/selectors", features = ["gecko_like_types"]}
|
||||
selectors = {path = "../../components/selectors"}
|
||||
servo_arc = {path = "../../components/servo_arc"}
|
||||
smallvec = "0.6"
|
||||
style = {path = "../../components/style", features = ["gecko"]}
|
||||
|
|
|
@ -20,7 +20,7 @@ geckoservo = {path = "../../../ports/geckolib"}
|
|||
libc = "0.2"
|
||||
log = {version = "0.3.5", features = ["release_max_level_info"]}
|
||||
malloc_size_of = {path = "../../../components/malloc_size_of"}
|
||||
selectors = {path = "../../../components/selectors", features = ["gecko_like_types"]}
|
||||
selectors = {path = "../../../components/selectors"}
|
||||
size_of_test = {path = "../../../components/size_of_test"}
|
||||
smallvec = "0.6"
|
||||
style_traits = {path = "../../../components/style_traits"}
|
||||
|
|
|
@ -2,29 +2,22 @@
|
|||
* 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/. */
|
||||
|
||||
use selectors::gecko_like_types as dummies;
|
||||
use selectors;
|
||||
use servo_arc::Arc;
|
||||
use std::mem::{size_of, align_of};
|
||||
use style;
|
||||
use style::applicable_declarations::ApplicableDeclarationBlock;
|
||||
use style::data::{ElementData, ElementStyles};
|
||||
use style::gecko::selector_parser as real;
|
||||
use style::gecko::selector_parser::{self, SelectorImpl};
|
||||
use style::properties::ComputedValues;
|
||||
use style::rule_tree::{RuleNode, StrongRuleNode};
|
||||
use style::values::computed;
|
||||
use style::values::specified;
|
||||
|
||||
#[test]
|
||||
fn size_of_selectors_dummy_types() {
|
||||
assert_eq!(size_of::<dummies::PseudoClass>(), size_of::<real::NonTSPseudoClass>());
|
||||
assert_eq!(align_of::<dummies::PseudoClass>(), align_of::<real::NonTSPseudoClass>());
|
||||
size_of_test!(size_of_selector, selectors::parser::Selector<SelectorImpl>, 8);
|
||||
size_of_test!(size_of_pseudo_element, selector_parser::PseudoElement, 24);
|
||||
|
||||
assert_eq!(size_of::<dummies::PseudoElement>(), size_of::<real::PseudoElement>());
|
||||
assert_eq!(align_of::<dummies::PseudoElement>(), align_of::<real::PseudoElement>());
|
||||
|
||||
assert_eq!(size_of::<dummies::Atom>(), size_of::<style::Atom>());
|
||||
assert_eq!(align_of::<dummies::Atom>(), align_of::<style::Atom>());
|
||||
}
|
||||
size_of_test!(size_of_component, selectors::parser::Component<SelectorImpl>, 32);
|
||||
size_of_test!(size_of_pseudo_class, selector_parser::NonTSPseudoClass, 24);
|
||||
|
||||
// The size of this is critical to performance on the bloom-basic microbenchmark.
|
||||
// When iterating over a large Rule array, we want to be able to fast-reject
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue