fix: move content_termination_test.go to content/ and fix app.go type mismatches
- commit
- 7c11dec61f35d114d971c4bc16731d485f8383f6
- author
- brice · · 2026-03-15 18:03 UTC
- parent
- 75beae6
- signature
- GPG Verified
CD88F9E564E0102646FB6077A1A07C7C7C3E349D· arch-gpg Verified for the committer email
3 files · +23 -10
M internal/ui/app.go +3 -3
| @@ -153,7 +153,7 @@ type floatingWorkspaceSession struct { | |||
| 153 | 153 | paneID entity.PaneID | |
| 154 | 154 | pane *component.FloatingPane | |
| 155 | 155 | paneView *component.PaneView | |
| 156 | - | webView *webkit.WebView | |
| 156 | + | webView port.WebView | |
| 157 | 157 | overlay layout.OverlayWidget | |
| 158 | 158 | widget layout.Widget | |
| 159 | 159 | focusWidget layout.Widget | |
| @@ -1559,7 +1559,7 @@ func (a *App) initCoordinators(ctx context.Context) { | |||
| 1559 | 1559 | a.tabCoord.SetOnQuit(a.Quit) | |
| 1560 | 1560 | a.tabCoord.SetOnStateChanged(a.MarkDirty) | |
| 1561 | 1561 | // Wire popup tab WebView attachment | |
| 1562 | - | a.tabCoord.SetOnAttachPopupToTab(func(ctx context.Context, tabID entity.TabID, pane *entity.Pane, wv *webkit.WebView) { | |
| 1562 | + | a.tabCoord.SetOnAttachPopupToTab(func(ctx context.Context, tabID entity.TabID, pane *entity.Pane, wv port.WebView) { | |
| 1563 | 1563 | a.attachPopupToTab(ctx, tabID, pane, wv) | |
| 1564 | 1564 | }) | |
| 1565 | 1565 | ||
| @@ -2149,7 +2149,7 @@ func (a *App) getActiveWebViewTarget() port.TextInputTarget { | |||
| 2149 | 2149 | ||
| 2150 | 2150 | // attachPopupToTab attaches a popup WebView to a newly created tab. | |
| 2151 | 2151 | // This is called when a popup uses tabbed behavior. | |
| 2152 | - | func (a *App) attachPopupToTab(ctx context.Context, tabID entity.TabID, pane *entity.Pane, wv *webkit.WebView) { | |
| 2152 | + | func (a *App) attachPopupToTab(ctx context.Context, tabID entity.TabID, pane *entity.Pane, wv port.WebView) { | |
| 2153 | 2153 | log := logging.FromContext(ctx) | |
| 2154 | 2154 | ||
| 2155 | 2155 | wsView := a.workspaceViews[tabID] | |
| @@ -153,7 +153,7 @@ type floatingWorkspaceSession struct { | |||||
| 153 | paneID entity.PaneID | 153 | paneID entity.PaneID | ||
| 154 | pane *component.FloatingPane | 154 | pane *component.FloatingPane | ||
| 155 | paneView *component.PaneView | 155 | paneView *component.PaneView | ||
| 156 | - | webView *webkit.WebView | 156 | + | webView port.WebView |
| 157 | overlay layout.OverlayWidget | 157 | overlay layout.OverlayWidget | ||
| 158 | widget layout.Widget | 158 | widget layout.Widget | ||
| 159 | focusWidget layout.Widget | 159 | focusWidget layout.Widget | ||
| @@ -1559,7 +1559,7 @@ func (a *App) initCoordinators(ctx context.Context) { | |||||
| 1559 | a.tabCoord.SetOnQuit(a.Quit) | 1559 | a.tabCoord.SetOnQuit(a.Quit) | ||
| 1560 | a.tabCoord.SetOnStateChanged(a.MarkDirty) | 1560 | a.tabCoord.SetOnStateChanged(a.MarkDirty) | ||
| 1561 | // Wire popup tab WebView attachment | 1561 | // Wire popup tab WebView attachment | ||
| 1562 | - | a.tabCoord.SetOnAttachPopupToTab(func(ctx context.Context, tabID entity.TabID, pane *entity.Pane, wv *webkit.WebView) { | 1562 | + | a.tabCoord.SetOnAttachPopupToTab(func(ctx context.Context, tabID entity.TabID, pane *entity.Pane, wv port.WebView) { |
| 1563 | a.attachPopupToTab(ctx, tabID, pane, wv) | 1563 | a.attachPopupToTab(ctx, tabID, pane, wv) | ||
| 1564 | }) | 1564 | }) | ||
| 1565 | 1565 | ||||
| @@ -2149,7 +2149,7 @@ func (a *App) getActiveWebViewTarget() port.TextInputTarget { | |||||
| 2149 | 2149 | ||||
| 2150 | // attachPopupToTab attaches a popup WebView to a newly created tab. | 2150 | // attachPopupToTab attaches a popup WebView to a newly created tab. | ||
| 2151 | // This is called when a popup uses tabbed behavior. | 2151 | // This is called when a popup uses tabbed behavior. | ||
| 2152 | - | func (a *App) attachPopupToTab(ctx context.Context, tabID entity.TabID, pane *entity.Pane, wv *webkit.WebView) { | 2152 | + | func (a *App) attachPopupToTab(ctx context.Context, tabID entity.TabID, pane *entity.Pane, wv port.WebView) { |
| 2153 | log := logging.FromContext(ctx) | 2153 | log := logging.FromContext(ctx) | ||
| 2154 | 2154 | ||||
| 2155 | wsView := a.workspaceViews[tabID] | 2155 | wsView := a.workspaceViews[tabID] | ||
R internal/ui/coordinator/content_termination_test.go → internal/ui/coordinator/content/content_termination_test.go +6 -6 renamed, 67% similar
| @@ -1,17 +1,17 @@ | |||
| 1 | - | package coordinator | |
| 1 | + | package content | |
| 2 | 2 | ||
| 3 | 3 | import ( | |
| 4 | 4 | "testing" | |
| 5 | 5 | ||
| 6 | - | webkitlib "github.com/bnema/puregotk-webkit/webkit" | |
| 6 | + | "github.com/bnema/dumber/internal/application/port" | |
| 7 | 7 | "github.com/stretchr/testify/assert" | |
| 8 | 8 | ) | |
| 9 | 9 | ||
| 10 | 10 | func TestShouldRenderCrashPage(t *testing.T) { | |
| 11 | - | assert.True(t, shouldRenderCrashPage(webkitlib.WebProcessCrashedValue)) | |
| 12 | - | assert.True(t, shouldRenderCrashPage(webkitlib.WebProcessExceededMemoryLimitValue)) | |
| 13 | - | assert.False(t, shouldRenderCrashPage(webkitlib.WebProcessTerminatedByApiValue)) | |
| 14 | - | assert.True(t, shouldRenderCrashPage(webkitlib.WebProcessTerminationReason(99))) | |
| 11 | + | assert.True(t, shouldRenderCrashPage(port.WebProcessTerminationCrashed)) | |
| 12 | + | assert.True(t, shouldRenderCrashPage(port.WebProcessTerminationExceededMemory)) | |
| 13 | + | assert.False(t, shouldRenderCrashPage(port.WebProcessTerminationByAPI)) | |
| 14 | + | assert.True(t, shouldRenderCrashPage(port.WebProcessTerminationReason(99))) | |
| 15 | 15 | } | |
| 16 | 16 | ||
| 17 | 17 | func TestExtractOriginalURIFromCrashPage(t *testing.T) { | |
| @@ -1,17 +1,17 @@ | |||||
| 1 | - | package coordinator | 1 | + | package content |
| 2 | 2 | ||||
| 3 | import ( | 3 | import ( | ||
| 4 | "testing" | 4 | "testing" | ||
| 5 | 5 | ||||
| 6 | - | webkitlib "github.com/bnema/puregotk-webkit/webkit" | 6 | + | "github.com/bnema/dumber/internal/application/port" |
| 7 | "github.com/stretchr/testify/assert" | 7 | "github.com/stretchr/testify/assert" | ||
| 8 | ) | 8 | ) | ||
| 9 | 9 | ||||
| 10 | func TestShouldRenderCrashPage(t *testing.T) { | 10 | func TestShouldRenderCrashPage(t *testing.T) { | ||
| 11 | - | assert.True(t, shouldRenderCrashPage(webkitlib.WebProcessCrashedValue)) | 11 | + | assert.True(t, shouldRenderCrashPage(port.WebProcessTerminationCrashed)) |
| 12 | - | assert.True(t, shouldRenderCrashPage(webkitlib.WebProcessExceededMemoryLimitValue)) | 12 | + | assert.True(t, shouldRenderCrashPage(port.WebProcessTerminationExceededMemory)) |
| 13 | - | assert.False(t, shouldRenderCrashPage(webkitlib.WebProcessTerminatedByApiValue)) | 13 | + | assert.False(t, shouldRenderCrashPage(port.WebProcessTerminationByAPI)) |
| 14 | - | assert.True(t, shouldRenderCrashPage(webkitlib.WebProcessTerminationReason(99))) | 14 | + | assert.True(t, shouldRenderCrashPage(port.WebProcessTerminationReason(99))) |
| 15 | } | 15 | } | ||
| 16 | 16 | ||||
| 17 | func TestExtractOriginalURIFromCrashPage(t *testing.T) { | 17 | func TestExtractOriginalURIFromCrashPage(t *testing.T) { | ||