Web Inspector: add TestSuite hooks for per-testcase setup and teardown actions
authorbburg@apple.com <bburg@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 1 Sep 2015 17:37:16 +0000 (17:37 +0000)
committerbburg@apple.com <bburg@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 1 Sep 2015 17:37:16 +0000 (17:37 +0000)
commit391b336d7e165c44584511948dce632b63c2a9b5
tree3f2e3ddf5e10fcb1db2128938349d383f1cd11b3
parentec97f42ff8c2a00c66b66f07a010dc08a6a70e48
Web Inspector: add TestSuite hooks for per-testcase setup and teardown actions
https://bugs.webkit.org/show_bug.cgi?id=148641

Reviewed by Timothy Hatcher.

Source/WebInspectorUI:

It should be possible to run setup and teardown actions for each test case.
The use case here is to add listeners, set up testcase-specific state, etc.
To match how test functions work in each suite, the sync and async implementations
take functions with no arguments and(resolve, reject), respectively.

* UserInterface/Test/TestSuite.js:
(TestSuite.prototype.addTestCase):
(TestSuite.messageFromThrownObject):
(TestSuite):
(AsyncTestSuite.prototype.runTestCases): Stick the extra functions in the chain.
(AsyncTestSuite):
(SyncTestSuite.prototype.runTestCases):
(SyncTestSuite):

LayoutTests:

Extend existing unit tests to also exercise setup and teardown actions.

* inspector/unit-tests/async-test-suite.html:
* inspector/unit-tests/async-test-suite-expected.txt:
* inspector/unit-tests/sync-test-suite.html:
* inspector/unit-tests/sync-test-suite-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@189213 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/inspector/unit-tests/async-test-suite-expected.txt
LayoutTests/inspector/unit-tests/async-test-suite.html
LayoutTests/inspector/unit-tests/sync-test-suite-expected.txt
LayoutTests/inspector/unit-tests/sync-test-suite.html
Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Test/TestSuite.js