Remove testing feature from style crate

This commit is contained in:
Manish Goregaokar 2017-08-05 23:55:26 -07:00
parent a6369149dc
commit 2ebce54d75
33 changed files with 63 additions and 1181 deletions

View file

@ -13,6 +13,7 @@ use style::properties::{longhands, Importance, PropertyDeclaration, PropertyDecl
use style::rule_tree::{CascadeLevel, RuleTree, StrongRuleNode, StyleSource};
use style::shared_lock::SharedRwLock;
use style::stylesheets::{Origin, Stylesheet, CssRule};
use style::thread_state;
use test::{self, Bencher};
struct ErrorringErrorReporter;
@ -92,6 +93,7 @@ fn test_insertion_style_attribute(rule_tree: &RuleTree, rules: &[(StyleSource, C
#[bench]
fn bench_insertion_basic(b: &mut Bencher) {
let r = RuleTree::new();
thread_state::initialize(thread_state::SCRIPT);
let rules_matched = parse_rules(
".foo { width: 200px; } \
@ -110,6 +112,7 @@ fn bench_insertion_basic(b: &mut Bencher) {
#[bench]
fn bench_insertion_basic_per_element(b: &mut Bencher) {
let r = RuleTree::new();
thread_state::initialize(thread_state::SCRIPT);
let rules_matched = parse_rules(
".foo { width: 200px; } \
@ -126,6 +129,7 @@ fn bench_insertion_basic_per_element(b: &mut Bencher) {
#[bench]
fn bench_expensive_insertion(b: &mut Bencher) {
let r = RuleTree::new();
thread_state::initialize(thread_state::SCRIPT);
// This test case tests a case where you style a bunch of siblings
// matching the same rules, with a different style attribute each
@ -148,6 +152,7 @@ fn bench_expensive_insertion(b: &mut Bencher) {
#[bench]
fn bench_insertion_basic_parallel(b: &mut Bencher) {
let r = RuleTree::new();
thread_state::initialize(thread_state::SCRIPT);
let rules_matched = parse_rules(
".foo { width: 200px; } \
@ -177,8 +182,9 @@ fn bench_insertion_basic_parallel(b: &mut Bencher) {
}
#[bench]
fn bench_expensive_insersion_parallel(b: &mut Bencher) {
fn bench_expensive_insertion_parallel(b: &mut Bencher) {
let r = RuleTree::new();
thread_state::initialize(thread_state::SCRIPT);
let rules_matched = parse_rules(
".foo { width: 200px; } \