Bug 178614

Summary: Web Inspector: Support `async test() { ... }` in Inspector Test Suites
Product: WebKit Reporter: Joseph Pecoraro <joepeck>
Component: Web InspectorAssignee: Joseph Pecoraro <joepeck>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, hi, inspector-bugzilla-changes, joepeck, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
[PATCH] Proposed Fix
none
[PATCH] Proposed Fix
hi: review+
[PATCH] For Landing none

Description Joseph Pecoraro 2017-10-20 21:32:39 PDT
Support `async test() { ... }` in Inspector Test Suites

So we can use `await` in test code.
Comment 1 Devin Rousso 2017-10-20 21:40:57 PDT
(In reply to Joseph Pecoraro from comment #0)
> Support `async test() { ... }` in Inspector Test Suites
> 
> So we can use `await` in test code.
😍
Comment 2 Joseph Pecoraro 2017-10-20 21:46:48 PDT
Created attachment 324485 [details]
[PATCH] Proposed Fix
Comment 3 Joseph Pecoraro 2017-10-20 21:49:29 PDT
Created attachment 324486 [details]
[PATCH] Proposed Fix
Comment 4 Devin Rousso 2017-10-20 22:05:13 PDT
Comment on attachment 324486 [details]
[PATCH] Proposed Fix

View in context: https://bugs.webkit.org/attachment.cgi?id=324486&action=review

r=me.  One typo.  Also waiting on the tests to make sure it's all good :)

> LayoutTests/inspector/unit-tests/async-test-suite.html:445
> +        description: "Check that an async suite with async test functions that throws with a runtime erorr will reject",

Typo.  "erorr" -> "error"

> Source/WebInspectorUI/UserInterface/Test/TestSuite.js:153
> +                if (testcase.test.toString().startsWith("async "))

This feels hacky, but I'm not sure if there's any other way around it :|
Comment 5 Joseph Pecoraro 2017-10-20 23:16:54 PDT
Created attachment 324490 [details]
[PATCH] For Landing
Comment 6 Joseph Pecoraro 2017-10-20 23:17:20 PDT
Comment on attachment 324486 [details]
[PATCH] Proposed Fix

View in context: https://bugs.webkit.org/attachment.cgi?id=324486&action=review

>> Source/WebInspectorUI/UserInterface/Test/TestSuite.js:153
>> +                if (testcase.test.toString().startsWith("async "))
> 
> This feels hacky, but I'm not sure if there's any other way around it :|

Switched to:

    if (testcase.test[Symbol.toStringTag] === "AsyncFunction")
Comment 7 WebKit Commit Bot 2017-10-20 23:52:50 PDT
Comment on attachment 324490 [details]
[PATCH] For Landing

Clearing flags on attachment: 324490

Committed r223809: <https://trac.webkit.org/changeset/223809>
Comment 8 Radar WebKit Bug Importer 2017-11-15 13:01:58 PST
<rdar://problem/35568648>