Audit support for own_property, inherits, readonly? |
||
Issue descriptionCurrently, if we want to use Audit to test properties or inheritance, we have to do that ourselves. However testharness has assert_own_property, assert_inherits, and assert_readonly. Perhaps we should add equivalents to Audit? Also, testharness has assert_throws which might be good for should.throw()
,
Mar 30 2017
We have equivalents for true, false, equals, not_equals, in_array (sort of?), array_equals, approx_equals, and throws. I don't expect we need regexp_match or unreached. That leaves just own_property, inherits, readonly. These are just convenience functions so I don't have to remember how to test own_property, inherits, and readonly.
,
Mar 30 2017
Okay then. I will add our own version of assertions for own_property, inherits, and readonly.
,
Apr 6 2017
rtoy@ Do you have any test that can use these new feature? I can include those changes in the CL.
,
Apr 6 2017
rtoy@ I am looking at how these assertions are implemented in testharness:
* readonly: This literally tries to overwrite the data and see if the value is changed. The comment on
the code also warns about the side effect of this check. I rather not have this in Audit.
* own_property:
should('propertyName').beOwnPropertyOf(Object);
* inherits: I think we are more interested in the relationship between class. So I think we want to have:
should(ChildObject).beInheritedFrom(ParentClassName);
,
Apr 6 2017
audio-scheduled-source-basic.html uses hasOwnProperty. Not having readonly is not a big deal, especially given how it's currently implemented in testharness. The other ideas look fine.
,
Apr 7 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/b7faac578f403d2a6bb4a767578661079cbf5963 commit b7faac578f403d2a6bb4a767578661079cbf5963 Author: hongchan <hongchan@chromium.org> Date: Fri Apr 07 19:48:02 2017 Implement ownProperty() and inheritFrom() assertions in should() This CL add two assertions that abstracts the checks for JavaScript traits. - should().ownProperty() - should().inheritFrom() BUG= 702708 TEST=webaudio/unit-tests/audit.html Review-Url: https://codereview.chromium.org/2805773002 Cr-Commit-Position: refs/heads/master@{#462970} [modify] https://crrev.com/b7faac578f403d2a6bb4a767578661079cbf5963/third_party/WebKit/LayoutTests/webaudio/audio-scheduled-source-basic.html [modify] https://crrev.com/b7faac578f403d2a6bb4a767578661079cbf5963/third_party/WebKit/LayoutTests/webaudio/resources/audit.js [modify] https://crrev.com/b7faac578f403d2a6bb4a767578661079cbf5963/third_party/WebKit/LayoutTests/webaudio/unit-tests/audit-expected.txt [modify] https://crrev.com/b7faac578f403d2a6bb4a767578661079cbf5963/third_party/WebKit/LayoutTests/webaudio/unit-tests/audit.html
,
Apr 8 2017
|
||
►
Sign in to add a comment |
||
Comment 1 by hongchan@chromium.org
, Mar 30 2017