Changeset 225814 in webkit
- Timestamp:
- Dec 12, 2017 3:13:04 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r225812 r225814 1 2017-12-12 Brian Burg <bburg@apple.com> 2 3 Web Inspector: SyncTestSuite should complain if passed an async setup/test/teardown function 4 https://bugs.webkit.org/show_bug.cgi?id=180717 5 6 Reviewed by Devin Rousso. 7 8 Add new test cases for more strict requirements for test case arguments. 9 10 * inspector/unit-tests/sync-test-suite-expected.txt: 11 * inspector/unit-tests/sync-test-suite.html: 12 1 13 2017-12-12 Antoine Quint <graouts@apple.com> 2 14 -
trunk/LayoutTests/inspector/unit-tests/sync-test-suite-expected.txt
r210367 r225814 14 14 PASS: should not be able to specify non-Function `teardown` parameter. 15 15 PASS: should not be able to specify non-Function `teardown` parameter. 16 PASS: should not be able to specify async `test` parameter. 17 PASS: should not be able to specify async `setup` parameter. 18 PASS: should not be able to specify async `teardown` parameter. 16 19 PASS: should not be able to run empty test suite. 17 20 -
trunk/LayoutTests/inspector/unit-tests/sync-test-suite.html
r210367 r225814 136 136 ProtocolTest.log("PASS: should not be able to specify non-Function `teardown` parameter."); 137 137 } 138 try { 139 badArgsSuite.addTestCase({ 140 name: "foo", 141 async test() {}, 142 }); 143 ProtocolTest.log("FAIL: should not be able to specify async `test` parameter."); 144 } catch (e) { 145 ProtocolTest.log("PASS: should not be able to specify async `test` parameter."); 146 } 147 try { 148 badArgsSuite.addTestCase({ 149 name: "foo", 150 async setup() {}, 151 test() {}, 152 }); 153 ProtocolTest.log("FAIL: should not be able to specify async `setup` parameter."); 154 } catch (e) { 155 ProtocolTest.log("PASS: should not be able to specify async `setup` parameter."); 156 } 157 try { 158 badArgsSuite.addTestCase({ 159 name: "foo", 160 test() {}, 161 async teardown() {}, 162 }); 163 ProtocolTest.log("FAIL: should not be able to specify async `teardown` parameter."); 164 } catch (e) { 165 ProtocolTest.log("PASS: should not be able to specify async `teardown` parameter."); 166 } 167 138 168 let runEmptySuite = ProtocolTest.createSyncSuite("SyncTestSuite.RunEmptySuite"); 139 169 try { -
trunk/Source/WebInspectorUI/ChangeLog
r225810 r225814 1 2017-12-12 Brian Burg <bburg@apple.com> 2 3 Web Inspector: SyncTestSuite should complain if passed an async setup/test/teardown function 4 https://bugs.webkit.org/show_bug.cgi?id=180717 5 6 Reviewed by Devin Rousso. 7 8 * UserInterface/Test/TestSuite.js: 9 (SyncTestSuite.prototype.addTestCase): 10 Raise an exception if test/setup/teardown is an async function. It won't work. 11 1 12 2017-12-12 Brian Burg <bburg@apple.com> 2 13 -
trunk/Source/WebInspectorUI/UserInterface/Test/TestSuite.js
r223809 r225814 176 176 SyncTestSuite = class SyncTestSuite extends TestSuite 177 177 { 178 addTestCase(testcase) 179 { 180 if ([testcase.setup, testcase.teardown, testcase.test].some((fn) => fn && fn[Symbol.toStringTag] === "AsyncFunction")) 181 throw new Error("Tried to pass a test case with an async `setup`, `test`, or `teardown` function, but this is a synchronous test suite.") 182 183 super.addTestCase(testcase); 184 } 185 178 186 runTestCasesAndFinish() 179 187 {
Note: See TracChangeset
for help on using the changeset viewer.