Changeset 250307 in webkit
- Timestamp:
- Sep 24, 2019 10:48:20 AM (5 years ago)
- Location:
- trunk/Tools
- Files:
-
- 5 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r250306 r250307 1 2019-09-24 Zhifei Fang <zhifei_fang@apple.com> 2 3 Add tests for Ref.js. 4 https://bugs.webkit.org/show_bug.cgi?id=201778. 5 6 Reviewed by Jonathan Bedard. 7 8 * resultsdbpy/resultsdbpy/view/static/library/js/Ref.js: 9 (applyStateDiff): null, 0, false are all valid state 10 (Ref.prototype.setState): We should do nothing for undefined stateDiff 11 * resultsdbpy/resultsdbpy/view/static/library/js/Test.js: Added. 12 (AssertFailedError): 13 (Expect): Perform assertions during unit tests. 14 (Expect.prototype.isType): 15 (Expect.prototype.equalToValue): 16 (Expect.prototype.equalToHtmlWithoutRef): 17 (Expect.prototype.notEqualToValue): 18 (Expect.prototype.greaterThan): 19 (Expect.prototype.greaterThanOrEqualTo): 20 (Expect.prototype.lessThan): 21 (Expect.prototype.lessThanOrEqualTo): 22 (TestSuite): Common TestSuite class for user to extend. 23 (TestSuite.prototype.expect): 24 (TestSuite.prototype.sleep): Test will sleep for certain ms 25 (TestSuite.prototype.waitForSignal): Wait until we receive a certain signal with timeout 26 (TestSuite.prototype.waitForRefMounted): Wait until we receive ref object's onElementMount signal with timeout 27 (TestSuite.prototype.waitForRefUnmounted): Wait until we receive ref object's onElementUnmount signal with timeout 28 (TestSuite.prototype.waitForStateUpdated):Wait until we receive ref object's onStateUpdate signal with timeout 29 (TestSuite.prototype.async.setup): Common interface for setup a test suite 30 (TestSuite.prototype.async.clearUp): Common interface for clear up a test suite 31 (getTestFucntionNames): Collect all the test method of a test instance. 32 (TestResult): 33 (TestResult.prototype.catchException): 34 (async.getTestResult): Run the test and generate a TestResult object 35 (TestController): 36 (TestController.prototype.addResultHandler): Test controller will send notification of a test result to result handler 37 (TestController.prototype.addSetupArgs): This gives some additional args for the common setup method for each test class, 38 it is the best place to setup something like a root element, a fake data source, etc 39 (TestController.prototype.collect): This method used for collect the test classes. 40 (TestController.prototype.async.collectFile): It will import the file as a module dynamicly and collect all the test classes that module export 41 (TestController.prototype.async.runTest): It will run a test method of a test class 42 (TestController.prototype.async.run): It will run all test or a test class or a test method 43 * resultsdbpy/resultsdbpy/view/static/library/js/components/TestComponents.js: components for test app. 44 * resultsdbpy/resultsdbpy/view/static/library/js/test/RefTest.js: Ref.js test cases. 45 * resultsdbpy/resultsdbpy/view/static/library/js/test/index.html: Test app entry. 46 1 47 2019-09-24 Wenson Hsieh <wenson_hsieh@apple.com> 2 48 -
trunk/Tools/resultsdbpy/resultsdbpy/view/static/library/js/Ref.js
r248305 r250307 218 218 219 219 function applyStateDiff(state, diff) { 220 if ( !diff)220 if (diff === undefined) 221 221 return state; 222 222 if (!isMergeableState(diff)) … … 276 276 } 277 277 setState(stateDiff) { 278 if (stateDiff === undefined) 279 return; 278 280 if (TRACE_STATE) 279 281 this.stateTracer.push(stateDiff);
Note: See TracChangeset
for help on using the changeset viewer.