Bug 189255 - Web Inspector: InspectorTest.expectException should work with SyncTestSuite
Summary: Web Inspector: InspectorTest.expectException should work with SyncTestSuite
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-09-03 20:34 PDT by Matt Baker
Modified: 2018-09-03 20:34 PDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Baker 2018-09-03 20:34:19 PDT
TestHarness.expectException returns a Promise, making it unsuitable for synchronous tests. There are a couple of options:

1) Do nothing: write tests that need expectException as async tests.
2) Create a separate synchronous version of expectException, with a new name.
3) Have expectException alter its behavior based on the return value of the `work` function.

Option 1 feels oppressive. Option 2 is unsightly, but straightforward. Option 3 is elegant, but obtuse and potentially surprising. I'm leaning toward 2.