Bug 178614 - Web Inspector: Support `async test() { ... }` in Inspector Test Suites
Summary: Web Inspector: Support `async test() { ... }` in Inspector Test Suites
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Joseph Pecoraro
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-10-20 21:32 PDT by Joseph Pecoraro
Modified: 2017-11-15 13:01 PST (History)
5 users (show)

See Also:


Attachments
[PATCH] Proposed Fix (26.76 KB, patch)
2017-10-20 21:46 PDT, Joseph Pecoraro
no flags Details | Formatted Diff | Diff
[PATCH] Proposed Fix (26.77 KB, patch)
2017-10-20 21:49 PDT, Joseph Pecoraro
hi: review+
Details | Formatted Diff | Diff
[PATCH] For Landing (26.78 KB, patch)
2017-10-20 23:16 PDT, Joseph Pecoraro
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>