From c369d0708ce1f8ae132fc25b763e0967d55c602d Mon Sep 17 00:00:00 2001 From: Bobby Holley Date: Tue, 6 Jun 2017 14:04:32 -0700 Subject: [PATCH] Add some size tests for ElementData and what's inside. MozReview-Commit-ID: Aj0rryEnJpl --- tests/unit/stylo/size_of.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/unit/stylo/size_of.rs b/tests/unit/stylo/size_of.rs index 3344a65c075..21bab9ba140 100644 --- a/tests/unit/stylo/size_of.rs +++ b/tests/unit/stylo/size_of.rs @@ -3,9 +3,13 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use selectors::gecko_like_types as dummies; +use servo_arc::Arc; use std::mem::{size_of, align_of}; use style; +use style::data::{ComputedStyle, ElementData, ElementStyles}; use style::gecko::selector_parser as real; +use style::properties::ComputedValues; +use style::rule_tree::StrongRuleNode; #[test] fn size_of_selectors_dummy_types() { @@ -24,6 +28,12 @@ fn size_of_selectors_dummy_types() { // selectors (with the inline hashes) with as few cache misses as possible. size_of_test!(test_size_of_rule, style::stylist::Rule, 40); +size_of_test!(test_size_of_option_arc_cv, Option>, 16); +size_of_test!(test_size_of_option_rule_node, Option, 16); +size_of_test!(test_size_of_computed_style, ComputedStyle, 56); +size_of_test!(test_size_of_element_styles, ElementStyles, 72); +size_of_test!(test_size_of_element_data, ElementData, 88); + size_of_test!(test_size_of_property_declaration, style::properties::PropertyDeclaration, 32); // This is huge, but we allocate it on the stack and then never move it,