Skip to content

Add toString() to Browser showing the underlying browser type#3259

Open
vogella wants to merge 1 commit intoeclipse-platform:masterfrom
vogella:browser-tostring-backend
Open

Add toString() to Browser showing the underlying browser type#3259
vogella wants to merge 1 commit intoeclipse-platform:masterfrom
vogella:browser-tostring-backend

Conversation

@vogella
Copy link
Copy Markdown
Contributor

@vogella vogella commented Apr 21, 2026

Summary

  • Override Browser.toString() to append the active browser backend (e.g. webkit, edge, ie, safari) returned by getBrowserType().
  • Makes it easy to identify which native browser implementation a Browser instance is using, both in the debugger and in log output, without having to drill into the internal webBrowser field.
  • The implementation calls webBrowser.getBrowserType() directly (with a null guard) instead of the public getBrowserType() method, because the public method calls checkWidget() which toString() is not expected to trigger (e.g. when called on a disposed widget or from a non-UI thread, mirroring Widget.toString() behavior).

Test plan

  • Open a Browser and inspect/print it; the result should look like Browser {} [webkit] (or the corresponding backend on Windows/macOS).
  • Inspect a disposed Browser and confirm toString() does not throw.

🤖 Generated with Claude Code

Override Browser.toString() to append the active browser backend (e.g.
"webkit", "edge", "ie", "safari") returned by getBrowserType(). This
makes it easy to see in the debugger or in logs which native browser
implementation a Browser instance is using, without having to drill
into the internal webBrowser field.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vogella vogella requested a review from HeikoKlare April 21, 2026 11:14
@github-actions
Copy link
Copy Markdown
Contributor

Test Results

  181 files   -  1    181 suites   - 1   27m 26s ⏱️ -18s
4 666 tests  - 57  4 625 ✅  - 75   20 💤  - 3  6 ❌ +6  15 🔥 +15 
6 755 runs   - 57  6 572 ✅  - 75  162 💤  - 3  6 ❌ +6  15 🔥 +15 

For more details on these failures and errors, see this check.

Results for commit 2ec0b30. ± Comparison against base commit f03d65d.

This pull request removes 57 tests.
org.eclipse.swt.graphics.ImageWin32Tests ‑ testDisposeDrawnImageBeforeRequestingTargetForOtherZoom
org.eclipse.swt.graphics.ImageWin32Tests ‑ testDrawImageAtDifferentZooms(boolean)[1] true
org.eclipse.swt.graphics.ImageWin32Tests ‑ testDrawImageAtDifferentZooms(boolean)[2] false
org.eclipse.swt.graphics.ImageWin32Tests ‑ testImageDataForDifferentFractionalZoomsShouldBeDifferent
org.eclipse.swt.graphics.ImageWin32Tests ‑ testImageShouldHaveDimesionAsPerZoomLevel
org.eclipse.swt.graphics.ImageWin32Tests ‑ testRetrieveImageDataAtDifferentZooms(boolean)[1] true
org.eclipse.swt.graphics.ImageWin32Tests ‑ testRetrieveImageDataAtDifferentZooms(boolean)[2] false
org.eclipse.swt.graphics.ImageWin32Tests ‑ test_getImageData_fromCopiedImage
org.eclipse.swt.graphics.ImageWin32Tests ‑ test_getImageData_fromImageForImageDataFromImage
org.eclipse.swt.tests.win32.Test_org_eclipse_swt_dnd_DND ‑ testByteArrayTransfer
…

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