Permalink
Browse files

Move selectors size_of tests to Stylo tests

  • Loading branch information...
SimonSapin committed Jan 12, 2018
1 parent 5d920df commit 7d1dc7286a76293e9c5dd3891a6e8ea051e3c09f
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -17,7 +17,6 @@ name = "selectors"
path = "lib.rs"
[features]
gecko_like_types = []
bench = []
[dependencies]
@@ -31,8 +30,5 @@ precomputed-hash = "0.1"
servo_arc = { version = "0.1", path = "../servo_arc" }
smallvec = "0.6"
[dev-dependencies]
size_of_test = {path = "../size_of_test"}
[build-dependencies]
phf_codegen = "0.7.18"

This file was deleted.

Oops, something went wrong.
@@ -12,7 +12,6 @@
extern crate fnv;
extern crate phf;
extern crate precomputed_hash;
#[cfg(test)] #[macro_use] extern crate size_of_test;
extern crate servo_arc;
extern crate smallvec;
@@ -23,8 +22,6 @@ pub mod context;
pub mod matching;
mod nth_index_cache;
pub mod parser;
#[cfg(test)] mod size_of_tests;
#[cfg(any(test, feature = "gecko_like_types"))] pub mod gecko_like_types;
pub mod sink;
mod tree;
pub mod visitor;

This file was deleted.

Oops, something went wrong.
@@ -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

0 comments on commit 7d1dc72

Please sign in to comment.