Skip to content

Add PaddingTest covering CSSPropertyPaddingSWTHandler#3979

Merged
vogella merged 1 commit intoeclipse-platform:masterfrom
vogella:css-tests-padding-handler
May 7, 2026
Merged

Add PaddingTest covering CSSPropertyPaddingSWTHandler#3979
vogella merged 1 commit intoeclipse-platform:masterfrom
vogella:css-tests-padding-handler

Conversation

@vogella
Copy link
Copy Markdown
Contributor

@vogella vogella commented May 7, 2026

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.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 7, 2026

Test Results

   858 files  +   777     858 suites  +777   55m 2s ⏱️ + 54m 30s
 7 976 tests + 6 223   7 733 ✅ + 6 001  243 💤 +222  0 ❌ ±0 
20 430 runs  +18 474  19 775 ✅ +17 868  655 💤 +606  0 ❌ ±0 

Results for commit adf545f. ± Comparison against base commit 336961f.

♻️ This comment has been updated with latest results.

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.
@vogella vogella force-pushed the css-tests-padding-handler branch from 34ca263 to adf545f Compare May 7, 2026 05:39
@vogella vogella merged commit a1b33b6 into eclipse-platform:master May 7, 2026
11 checks passed
@vogella vogella deleted the css-tests-padding-handler branch May 7, 2026 07:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant