Skip to content

Add CSS selector integration tests for tab selection, .active class, and preference pseudo#3983

Merged
vogella merged 1 commit intoeclipse-platform:masterfrom
vogella:css-tests-selector-integration
May 8, 2026
Merged

Add CSS selector integration tests for tab selection, .active class, and preference pseudo#3983
vogella merged 1 commit intoeclipse-platform:masterfrom
vogella:css-tests-selector-integration

Conversation

@vogella
Copy link
Copy Markdown
Contributor

@vogella vogella commented May 7, 2026

Adds three JUnit 5 tests under tests/org.eclipse.e4.ui.tests.css.swt that pin engine behaviours not covered end-to-end today: how CTabItem:selected rules surface on CTabFolder#getSelectionForeground/Background and how the CTabFolderElement SWT selection listener triggers a reapply, how CTabFolder.active rules toggle on WidgetElement#setCSSClass, and how the IEclipsePreferences#node:contributor pseudo selector form (Bug 466075) lets multiple stylesheets contribute to the same preference node.

Two scenarios were adjusted to match observed behaviour rather than the originally drafted expectation. The selected-foreground assertion runs against folder.getSelectionForeground() (consistent with the existing CTabItemTest#testSelectionForeground) instead of CTabItem#getForeground(), and the listener path is exercised by dispatching an SWT.Selection event because programmatic CTabFolder#setSelection does not fire it. The "clearing .active reverts the background" case was flipped: the folder retains the previously painted background after the class is cleared, so the test pins that behaviour with a comment so a future revert fix shows up as a failure.

The third scenario (IEclipsePreferences#node:key) was reframed: the pseudo slot in shipped CSS is a contributor namespace tag (Bug 466075), not a preference key, and EclipsePreferencesHandler only acts on the preferences: declaration. An additional cascade-override test pins the source-order tiebreak: when two equal-specificity rules under the same pseudo write the same preference key, the later rule wins because viewCSS resolves the duplicate preferences: property before the handler runs. The class javadocs were trimmed to single sentences with the non-obvious context kept as inline comments next to the relevant assertions.

@vogella vogella force-pushed the css-tests-selector-integration branch from 1c9d07b to 3cb397e Compare May 7, 2026 13:17
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 7, 2026

Test Results

   867 files  + 9     867 suites  +9   55m 7s ⏱️ +40s
 7 986 tests + 9   7 743 ✅ + 9  243 💤 ±0  0 ❌ ±0 
20 460 runs  +27  19 805 ✅ +27  655 💤 ±0  0 ❌ ±0 

Results for commit 6622d2a. ± Comparison against base commit a2d8374.

♻️ This comment has been updated with latest results.

@vogella vogella force-pushed the css-tests-selector-integration branch 2 times, most recently from 6468cbd to ffcd8e6 Compare May 7, 2026 18:39
…and preference pseudo

Pins three engine behaviours not covered by the matcher/parser unit
tests: CTabItem:selected styling on the parent CTabFolder,
CTabFolder.active painting, and IEclipsePreferences#node:pseudo
matching.

Also registers the new classes (plus a previously orphaned core test)
in the test suites so the nightly integration build runs them.
@vogella vogella force-pushed the css-tests-selector-integration branch from ffcd8e6 to 6622d2a Compare May 7, 2026 19:21
@vogella vogella merged commit c49ef2b into eclipse-platform:master May 8, 2026
18 checks passed
@vogella vogella deleted the css-tests-selector-integration branch May 8, 2026 08:13
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