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

@ -304,18 +304,8 @@ class StyleStruct(object):
class PropertiesData(object):
"""
The `testing` parameter means that we're running tests.
In this situation, the `product` value is ignored while choosing
which shorthands and longhands to generate; and instead all properties for
which code exists for either servo or stylo are generated. Note that we skip
this behavior when the style crate is being built in gecko mode, because we
need manual glue for such properties and we don't have it.
"""
def __init__(self, product, testing):
def __init__(self, product):
self.product = product
self.testing = testing and product != "gecko"
self.style_structs = []
self.current_style_struct = None
self.longhands = []
@ -338,9 +328,9 @@ class PropertiesData(object):
for prefix in property.extra_prefixes:
property.alias.append('-%s-%s' % (prefix, property.name))
def declare_longhand(self, name, products="gecko servo", disable_when_testing=False, **kwargs):
def declare_longhand(self, name, products="gecko servo", **kwargs):
products = products.split()
if self.product not in products and not (self.testing and not disable_when_testing):
if self.product not in products:
return
longhand = Longhand(self.current_style_struct, name, **kwargs)
@ -354,10 +344,9 @@ class PropertiesData(object):
return longhand
def declare_shorthand(self, name, sub_properties, products="gecko servo",
disable_when_testing=False, *args, **kwargs):
def declare_shorthand(self, name, sub_properties, products="gecko servo", *args, **kwargs):
products = products.split()
if self.product not in products and not (self.testing and not disable_when_testing):
if self.product not in products:
return
sub_properties = [self.longhands_by_name[s] for s in sub_properties]