Bug 164607 - Web Inspector: TestSuite should pass the test case to setup/teardown
Summary: Web Inspector: TestSuite should pass the test case to setup/teardown
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Matt Baker
URL:
Keywords: InRadar
Depends on:
Blocks: 163230
  Show dependency treegraph
 
Reported: 2016-11-10 12:20 PST by Matt Baker
Modified: 2016-11-10 15:53 PST (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Baker 2016-11-10 12:20:06 PST
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.
Comment 1 Radar WebKit Bug Importer 2016-11-10 12:22:39 PST
<rdar://problem/29204593>
Comment 2 Matt Baker 2016-11-10 15:36:38 PST
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.