Add PaddingTest covering CSSPropertyPaddingSWTHandler#3979
Merged
vogella merged 1 commit intoeclipse-platform:masterfrom May 7, 2026
Merged
Add PaddingTest covering CSSPropertyPaddingSWTHandler#3979vogella merged 1 commit intoeclipse-platform:masterfrom
vogella merged 1 commit intoeclipse-platform:masterfrom
Conversation
Contributor
The padding handler had no direct or indirect test coverage. The handler only takes effect when the target widget is a CTabFolder whose renderer exposes getPadding() returning a Rectangle and setPadding(int,int,int,int); the default CTabFolderRenderer ships without those methods, so the handler's reflective lookup throws NoSuchMethodException which the handler swallows silently. Adds a CapturingRenderer test subclass that exposes the two methods, records the arguments passed to setPadding, and asserts the shorthand (1, 2, 4 value forms) and per-side (top/right/bottom/left) properties route to the renderer with the values the handler is documented to send. Two additional tests lock in current behaviour on the no-op paths: padding on a non-CTabFolder widget and padding on a CTabFolder with the default renderer must not surface an error. A final test pins down that non-CSS_PX units are silently ignored.
34ca263 to
adf545f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The padding handler had no direct or indirect test coverage. The handler only takes effect when the target widget is a CTabFolder whose renderer exposes getPadding() returning a Rectangle and setPadding(int,int,int,int); the default CTabFolderRenderer ships without those methods, so the handler's reflective lookup throws NoSuchMethodException which the handler swallows silently.
Adds a CapturingRenderer test subclass that exposes the two methods, records the arguments passed to setPadding, and asserts the shorthand (1, 2, 4 value forms) and per-side (top/right/bottom/left) properties route to the renderer with the values the handler is documented to send. Two additional tests lock in current behaviour on the no-op paths: padding on a non-CTabFolder widget and padding on a CTabFolder with the default renderer must not surface an error. A final test pins down that non-CSS_PX units are silently ignored.