v0.27.2 5960dd8

webkit_stack_test.go RawHistoryFolder

1package bootstrap
2
3import (
4	"testing"
5
6	"github.com/bnema/dumber/internal/application/port"
7	"github.com/bnema/dumber/internal/infrastructure/config"
8	"github.com/jwijenbergh/puregotk/v4/gdk"
9	"github.com/stretchr/testify/assert"
10	"github.com/stretchr/testify/require"
11)
12
13func TestBuildWebKitContextOptions_MapsPrivacyAndMemory(t *testing.T) {
14	cfg := config.DefaultConfig()
15	cfg.Privacy.CookiePolicy = config.CookiePolicyNever
16	cfg.Privacy.ITPEnabled = false
17
18	perf := &config.ResolvedPerformanceSettings{
19		WebProcessMemoryLimitMB:               1024,
20		WebProcessMemoryPollIntervalSec:       11,
21		WebProcessMemoryConservativeThreshold: 0.25,
22		WebProcessMemoryStrictThreshold:       0.5,
23		NetworkProcessMemoryLimitMB:           512,
24		NetworkProcessMemoryPollIntervalSec:   13,
25	}
26
27	opts := buildWebKitContextOptions(cfg, "/tmp/data", "/tmp/cache", perf)
28
29	assert.Equal(t, "/tmp/data", opts.DataDir)
30	assert.Equal(t, "/tmp/cache", opts.CacheDir)
31	assert.Equal(t, port.WebKitCookiePolicyNever, opts.CookiePolicy)
32	assert.False(t, opts.ITPEnabled)
33
34	require.NotNil(t, opts.WebProcessMemory)
35	assert.Equal(t, 1024, opts.WebProcessMemory.MemoryLimitMB)
36	assert.InDelta(t, 11.0, opts.WebProcessMemory.PollIntervalSec, 1e-9)
37	assert.InDelta(t, 0.25, opts.WebProcessMemory.ConservativeThreshold, 1e-9)
38	assert.InDelta(t, 0.5, opts.WebProcessMemory.StrictThreshold, 1e-9)
39
40	require.NotNil(t, opts.NetworkProcessMemory)
41	assert.Equal(t, 512, opts.NetworkProcessMemory.MemoryLimitMB)
42	assert.InDelta(t, 13.0, opts.NetworkProcessMemory.PollIntervalSec, 1e-9)
43}
44
45func TestBuildWebKitContextOptions_DefaultPrivacyWhenConfigNil(t *testing.T) {
46	opts := buildWebKitContextOptions(nil, "/tmp/data", "/tmp/cache", &config.ResolvedPerformanceSettings{})
47
48	assert.Equal(t, port.WebKitCookiePolicyNoThirdParty, opts.CookiePolicy)
49	assert.True(t, opts.ITPEnabled)
50}
51
52func TestShouldPrewarmFirstWebView(t *testing.T) {
53	assert.False(t, shouldPrewarmFirstWebView(nil))
54	assert.True(t, shouldPrewarmFirstWebView(&gdk.Display{}))
55}

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 8

Tags 42

↑↓ moveenter openesc close