|
|
Created:
4 years ago by meade_UTC10 Modified:
4 years ago CC:
blink-reviews, blink-reviews-style_chromium.org, chromium-reviews, rjwright Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionAdd a property test generator for testing the inline StylePropertyMap
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
Committed: https://crrev.com/09bfd57f7db4f626a19d29e3ee9ca6d1ae3eb1dd
Cr-Commit-Position: refs/heads/master@{#435569}
Patch Set 1 #Patch Set 2 : Simplify contents of CL #Patch Set 3 : Update test names and add list-supporting property test #Patch Set 4 : Use animation-direction instead of animation-iteration-count for a list-valued test #Patch Set 5 : Add expectation files #
Total comments: 22
Patch Set 6 : Address CL comments #Patch Set 7 : update to use for..of and let #Patch Set 8 : Fix typo #
Messages
Total messages: 26 (12 generated)
Description was changed from ========== [WIP] Add a property test generator for testing the inline StylePropertyMap This will allow easier testing of each property as we add support in CSS Typed OM, as we will not have to hand-write tests for each element any more, and we will easily be able to add a new test that applies to every element if we need to later. BUG=545318 ========== to ========== [WIP] Add a property test generator for testing the inline StylePropertyMap 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 - 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. BUG=545318 ==========
Description was changed from ========== [WIP] Add a property test generator for testing the inline StylePropertyMap 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 - 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. BUG=545318 ========== to ========== [WIP] Add a property test generator for testing the inline StylePropertyMap 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 - 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 ==========
Description was changed from ========== [WIP] Add a property test generator for testing the inline StylePropertyMap 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 - 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 ========== to ========== [WIP] Add a property test generator for testing the inline StylePropertyMap 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 ==========
Description was changed from ========== [WIP] Add a property test generator for testing the inline StylePropertyMap 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 ========== to ========== Add a property test generator for testing the inline StylePropertyMap 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 ==========
meade@chromium.org changed reviewers: + shans@chromium.org
Shane: PTAL, thanks! Renee: FYI
lgtm! I really like this approach - it looks like it's going to exhaustively test right across the API without too much bother.
meade@chromium.org changed reviewers: + dstockwell@chromium.org
Thanks Shane! Doug, PTAL for OWNERS? Thank you!
lgtm https://codereview.chromium.org/2529043002/diff/80001/third_party/WebKit/Layo... File third_party/WebKit/LayoutTests/typedcssom/inlinestyle/properties/animation-direction.html (right): https://codereview.chromium.org/2529043002/diff/80001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/typedcssom/inlinestyle/properties/animation-direction.html:6: <div id="testElement"></div> The suite should just generate this element. https://codereview.chromium.org/2529043002/diff/80001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/typedcssom/inlinestyle/properties/animation-direction.html:25: generatePropertySuite('animation-direction', config, testElement); Simpler to just inline to config here and make the property part of it. https://codereview.chromium.org/2529043002/diff/80001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/typedcssom/inlinestyle/properties/animation-direction.html:25: generatePropertySuite('animation-direction', config, testElement); Simpler to just inline to config here. Calling this generate* is a bit weird too, since it actually runs the test. So maybe something like: testTypedOM('animation-direction', { ... https://codereview.chromium.org/2529043002/diff/80001/third_party/WebKit/Layo... File third_party/WebKit/LayoutTests/typedcssom/inlinestyle/properties/bottom-expected.txt (right): https://codereview.chromium.org/2529043002/diff/80001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/typedcssom/inlinestyle/properties/bottom-expected.txt:26: FAIL Getting bottom with a CSSCalcLength whose value is calc(10% + 1px) assert_equals: expected function "function CSSCalcLength() { [native code] }" but got function "function CSSStyleValue() { [native code] }" Can we do better with the failure messages here? https://codereview.chromium.org/2529043002/diff/80001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/css/CSSProperties.in (right): https://codereview.chromium.org/2529043002/diff/80001/third_party/WebKit/Sour... third_party/WebKit/Source/core/css/CSSProperties.in:122: animation-direction keywords=[normal|reverse|alternate|alternate-reverse], supports_multiple, custom_all supports_multiple is a really weird name btw, something like value_list or repeated would be much clearer. Shouldn't this be on all of the animation properties here?
lgtm https://codereview.chromium.org/2529043002/diff/80001/third_party/WebKit/Layo... File third_party/WebKit/LayoutTests/typedcssom/inlinestyle/properties/animation-direction.html (right): https://codereview.chromium.org/2529043002/diff/80001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/typedcssom/inlinestyle/properties/animation-direction.html:6: <div id="testElement"></div> The suite should just generate this element. https://codereview.chromium.org/2529043002/diff/80001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/typedcssom/inlinestyle/properties/animation-direction.html:25: generatePropertySuite('animation-direction', config, testElement); Simpler to just inline to config here and make the property part of it. https://codereview.chromium.org/2529043002/diff/80001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/typedcssom/inlinestyle/properties/animation-direction.html:25: generatePropertySuite('animation-direction', config, testElement); Simpler to just inline to config here. Calling this generate* is a bit weird too, since it actually runs the test. So maybe something like: testTypedOM('animation-direction', { ... https://codereview.chromium.org/2529043002/diff/80001/third_party/WebKit/Layo... File third_party/WebKit/LayoutTests/typedcssom/inlinestyle/properties/bottom-expected.txt (right): https://codereview.chromium.org/2529043002/diff/80001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/typedcssom/inlinestyle/properties/bottom-expected.txt:26: FAIL Getting bottom with a CSSCalcLength whose value is calc(10% + 1px) assert_equals: expected function "function CSSCalcLength() { [native code] }" but got function "function CSSStyleValue() { [native code] }" Can we do better with the failure messages here? https://codereview.chromium.org/2529043002/diff/80001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/css/CSSProperties.in (right): https://codereview.chromium.org/2529043002/diff/80001/third_party/WebKit/Sour... third_party/WebKit/Source/core/css/CSSProperties.in:122: animation-direction keywords=[normal|reverse|alternate|alternate-reverse], supports_multiple, custom_all supports_multiple is a really weird name btw, something like value_list or repeated would be much clearer. Shouldn't this be on all of the animation properties here?
https://codereview.chromium.org/2529043002/diff/80001/third_party/WebKit/Layo... File third_party/WebKit/LayoutTests/typedcssom/inlinestyle/properties/property-suite.js (right): https://codereview.chromium.org/2529043002/diff/80001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/typedcssom/inlinestyle/properties/property-suite.js:121: assert_equals(element.style[propertyName], validObject.cssText + ' ' + validObject.cssText); BTW shouldn't this be comma separated?
qyearsley@chromium.org changed reviewers: + qyearsley@chromium.org
https://codereview.chromium.org/2529043002/diff/80001/third_party/WebKit/Layo... File third_party/WebKit/LayoutTests/typedcssom/inlinestyle/properties/property-suite.js (right): https://codereview.chromium.org/2529043002/diff/80001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/typedcssom/inlinestyle/properties/property-suite.js:3: * inline StylePropertyMap. Might be helpful to add a link to the spec, e.g. https://www.w3.org/TR/css-typed-om-1/#the-stylepropertymap https://codereview.chromium.org/2529043002/diff/80001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/typedcssom/inlinestyle/properties/property-suite.js:6: * validKeywords: [list of strings], Do the square brackets here indicate that this is an Array? This may be redundant since you already say it's a list. https://codereview.chromium.org/2529043002/diff/80001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/typedcssom/inlinestyle/properties/property-suite.js:18: * Finally, call "generatePropertySuite" to generate the standard set of tests. Possible optional rephrasing: Call generatePropertySuite to test the behavior of an inline StylePropertyMap for one CSS property for a given element. https://codereview.chromium.org/2529043002/diff/80001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/typedcssom/inlinestyle/properties/property-suite.js:24: function generatePropertySuite(propertyName, config, element) { Arguably, these functions could also be named as "test*" instead of "generate*", since they invoke test() and don't return anything, e.g. testPropertySuite testSet testGet testGetAll testDelete testGetProperties testSetSequence testAppend testMultipleValuesNotSupported Although "generate" is also fine. https://codereview.chromium.org/2529043002/diff/80001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/typedcssom/inlinestyle/properties/property-suite.js:26: // CSS wide keywords Nit: CSS-wide could be written with a dash.
https://codereview.chromium.org/2529043002/diff/80001/third_party/WebKit/Layo... File third_party/WebKit/LayoutTests/typedcssom/inlinestyle/properties/animation-direction.html (right): https://codereview.chromium.org/2529043002/diff/80001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/typedcssom/inlinestyle/properties/animation-direction.html:6: <div id="testElement"></div> On 2016/11/29 06:26:35, dstockwell wrote: > The suite should just generate this element. Done. https://codereview.chromium.org/2529043002/diff/80001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/typedcssom/inlinestyle/properties/animation-direction.html:25: generatePropertySuite('animation-direction', config, testElement); On 2016/11/29 06:26:35, dstockwell wrote: > Simpler to just inline to config here. > > Calling this generate* is a bit weird too, since it actually runs the test. > > So maybe something like: > testTypedOM('animation-direction', { ... Done. https://codereview.chromium.org/2529043002/diff/80001/third_party/WebKit/Layo... File third_party/WebKit/LayoutTests/typedcssom/inlinestyle/properties/bottom-expected.txt (right): https://codereview.chromium.org/2529043002/diff/80001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/typedcssom/inlinestyle/properties/bottom-expected.txt:26: FAIL Getting bottom with a CSSCalcLength whose value is calc(10% + 1px) assert_equals: expected function "function CSSCalcLength() { [native code] }" but got function "function CSSStyleValue() { [native code] }" On 2016/11/29 06:26:35, dstockwell wrote: > Can we do better with the failure messages here? Done. https://codereview.chromium.org/2529043002/diff/80001/third_party/WebKit/Layo... File third_party/WebKit/LayoutTests/typedcssom/inlinestyle/properties/property-suite.js (right): https://codereview.chromium.org/2529043002/diff/80001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/typedcssom/inlinestyle/properties/property-suite.js:3: * inline StylePropertyMap. On 2016/11/30 18:37:24, qyearsley (OOO until Nov 30) wrote: > Might be helpful to add a link to the spec, e.g. > https://www.w3.org/TR/css-typed-om-1/#the-stylepropertymap Done. https://codereview.chromium.org/2529043002/diff/80001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/typedcssom/inlinestyle/properties/property-suite.js:6: * validKeywords: [list of strings], On 2016/11/30 18:37:24, qyearsley (OOO until Nov 30) wrote: > Do the square brackets here indicate that this is an Array? This may be > redundant since you already say it's a list. Done. https://codereview.chromium.org/2529043002/diff/80001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/typedcssom/inlinestyle/properties/property-suite.js:18: * Finally, call "generatePropertySuite" to generate the standard set of tests. On 2016/11/30 18:37:24, qyearsley (OOO until Nov 30) wrote: > Possible optional rephrasing: Call generatePropertySuite to test the behavior of > an inline StylePropertyMap for one CSS property for a given element. Done. https://codereview.chromium.org/2529043002/diff/80001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/typedcssom/inlinestyle/properties/property-suite.js:24: function generatePropertySuite(propertyName, config, element) { On 2016/11/30 18:37:24, qyearsley (OOO until Nov 30) wrote: > Arguably, these functions could also be named as "test*" instead of "generate*", > since they invoke test() and don't return anything, e.g. > > testPropertySuite > testSet > testGet > testGetAll > testDelete > testGetProperties > testSetSequence > testAppend > testMultipleValuesNotSupported > > Although "generate" is also fine. I had actually renamed these to "runFooTests" but haven't uploaded... https://codereview.chromium.org/2529043002/diff/80001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/typedcssom/inlinestyle/properties/property-suite.js:26: // CSS wide keywords On 2016/11/30 18:37:24, qyearsley (OOO until Nov 30) wrote: > Nit: CSS-wide could be written with a dash. Done. https://codereview.chromium.org/2529043002/diff/80001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/typedcssom/inlinestyle/properties/property-suite.js:121: assert_equals(element.style[propertyName], validObject.cssText + ' ' + validObject.cssText); On 2016/11/29 20:58:13, shans wrote: > BTW shouldn't this be comma separated? Ugh, yes. I should really fix that bug...
https://codereview.chromium.org/2529043002/diff/80001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/css/CSSProperties.in (right): https://codereview.chromium.org/2529043002/diff/80001/third_party/WebKit/Sour... third_party/WebKit/Source/core/css/CSSProperties.in:122: animation-direction keywords=[normal|reverse|alternate|alternate-reverse], supports_multiple, custom_all On 2016/11/29 06:26:35, dstockwell wrote: > supports_multiple is a really weird name btw, something like value_list or > repeated would be much clearer. Shouldn't this be on all of the animation > properties here? I'll follow the naming up in a separate patch. As for adding it to each animation property, I was planning on adding the Typed OM info and tests to each property one by one, maybe in a burndown.
The CQ bit was checked by meade@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from dstockwell@chromium.org, shans@chromium.org Link to the patchset: https://codereview.chromium.org/2529043002/#ps140001 (title: "Fix typo")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch. Bot data: {"patchset_id": 140001, "attempt_start_ts": 1480571404949340, "parent_rev": "fa0c68cf494bf598c748384ef5d54386f7eda67f", "commit_rev": "97c19f7d93d2bb3f20ebe2ec9e7d55e816963e87"}
Message was sent while issue was closed.
Description was changed from ========== Add a property test generator for testing the inline StylePropertyMap 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 ========== to ========== Add a property test generator for testing the inline StylePropertyMap 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 ==========
Message was sent while issue was closed.
Committed patchset #8 (id:140001)
Message was sent while issue was closed.
Description was changed from ========== Add a property test generator for testing the inline StylePropertyMap 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 ========== to ========== Add a property test generator for testing the inline StylePropertyMap 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 Committed: https://crrev.com/09bfd57f7db4f626a19d29e3ee9ca6d1ae3eb1dd Cr-Commit-Position: refs/heads/master@{#435569} ==========
Message was sent while issue was closed.
Patchset 8 (id:??) landed as https://crrev.com/09bfd57f7db4f626a19d29e3ee9ca6d1ae3eb1dd Cr-Commit-Position: refs/heads/master@{#435569}
Message was sent while issue was closed.
https://codereview.chromium.org/2529043002/diff/80001/third_party/WebKit/Layo... File third_party/WebKit/LayoutTests/typedcssom/inlinestyle/properties/property-suite.js (right): https://codereview.chromium.org/2529043002/diff/80001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/typedcssom/inlinestyle/properties/property-suite.js:24: function generatePropertySuite(propertyName, config, element) { On 2016/12/01 at 03:48:20, Eddy wrote: > On 2016/11/30 18:37:24, qyearsley (OOO until Nov 30) wrote: > > Arguably, these functions could also be named as "test*" instead of "generate*", > > since they invoke test() and don't return anything, e.g. > > > > testPropertySuite > > testSet > > testGet > > testGetAll > > testDelete > > testGetProperties > > testSetSequence > > testAppend > > testMultipleValuesNotSupported > > > > Although "generate" is also fine. > > I had actually renamed these to "runFooTests" but haven't uploaded... That sounds good to me too :-) |