-
meade authored
This will allow easier testing of each property as we add support in CSS Typed OM, as we will not have to hand-write exhaustive tests for each property, and we will easily be able to add a new test that applies to every element easily if we need to later. The standard set of tests is: *single-valued properties* - Setting with a sequence of valid values throws - Calling append with a valid value throws *list-valued properties* - Setting with a sequence of valid values works - Setting with a sequence containing valid and invalid values throws - Append succeeds with a valid value - Appending a sequence of valid values succeeds - Append throws when given an invalid value - Append throws when given a sequence containing valid and invalid values - GetAll when the property is set to a list returns all the properties *common* - Can be set to each valid keyword (automatically adds initial, inherit and unset) - Can be set to each given valid instance of StyleValue - Setting to an invalid type throws (automatically adds null, undefined, true, false, 1, 'hello', {}, and a fake keyword) - Get returns the right KeywordValue when the property is set to each valid keyword - Get returns the right StyleValue when the property is set to .cssText of each given valid StyleValue - GetAll works when the property is set to a valid StyleValue instance - Delete removes the style from the element - GetProperties includes the name of the property when it is set to something I've added example tests for "bottom" and "animation-direction", as semi-random, convenient single-valued and list-valued properties. Note that since getting CSSKeyword from a StylePropertyMap is not yet fully supported, the new tests fail. BUG=545318 Review-Url: https://codereview.chromium.org/2529043002 Cr-Commit-Position: refs/heads/master@{#435569}
09bfd57f