Bug 164607
Summary: | Web Inspector: TestSuite should pass the test case to setup/teardown | ||
---|---|---|---|
Product: | WebKit | Reporter: | Matt Baker <mattbaker> |
Component: | Web Inspector | Assignee: | Matt Baker <mattbaker> |
Status: | RESOLVED WONTFIX | ||
Severity: | Normal | CC: | bburg, joepeck, mattbaker, nvasilyev, timothy, webkit-bug-importer |
Priority: | P2 | Keywords: | InRadar |
Version: | WebKit Nightly Build | ||
Hardware: | All | ||
OS: | All | ||
Bug Depends on: | |||
Bug Blocks: | 163230 |
Matt Baker
Summary:
TestSuite should pass the test case to setup/teardown. This allows setup to associate state with the test case itself, instead of with the `window` object or within the scope of the `test()` function.
This should be done for both AsyncTestSuite and SyncTestSuite.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/29204593>
Matt Baker
Setup/teardown could just use `this` to access test case state. There are only two issues with this approach, and they both seem pretty far fetched:
1) Using `this` in arrow function for setup/teardown will bind to something other than the test case. Setup/teardown are usually inline, and if they need to be defined elsewhere (for reuse in multiple tests), a regular named function will work.
2) However unlikely, the test case itself could trample state that was created during setup.