<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>164607</bug_id>
          
          <creation_ts>2016-11-10 12:20:06 -0800</creation_ts>
          <short_desc>Web Inspector: TestSuite should pass the test case to setup/teardown</short_desc>
          <delta_ts>2016-11-10 15:53:51 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Web Inspector</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>163230</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Matt Baker">mattbaker</reporter>
          <assigned_to name="Matt Baker">mattbaker</assigned_to>
          <cc>bburg</cc>
    
    <cc>joepeck</cc>
    
    <cc>mattbaker</cc>
    
    <cc>nvasilyev</cc>
    
    <cc>timothy</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1249905</commentid>
    <comment_count>0</comment_count>
    <who name="Matt Baker">mattbaker</who>
    <bug_when>2016-11-10 12:20:06 -0800</bug_when>
    <thetext>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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1249909</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2016-11-10 12:22:39 -0800</bug_when>
    <thetext>&lt;rdar://problem/29204593&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1250011</commentid>
    <comment_count>2</comment_count>
    <who name="Matt Baker">mattbaker</who>
    <bug_when>2016-11-10 15:36:38 -0800</bug_when>
    <thetext>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.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>