v0.33.1 9577fee

adaptive_frame_rate_test.go RawHistoryFolder

1package cef
2
3import "testing"
4
5func TestAdaptiveFrameRateForRefresh(t *testing.T) {
6	tests := []struct {
7		name           string
8		refreshMilliHz int
9		fallbackFPS    int32
10		maxFPS         int32
11		want           int32
12	}{
13		{name: "fallback unknown", refreshMilliHz: 0, fallbackFPS: 60, maxFPS: 240, want: 60},
14		{name: "uses monitor refresh", refreshMilliHz: 144000, fallbackFPS: 60, maxFPS: 240, want: 144},
15		{name: "uses lower refresh monitor", refreshMilliHz: 50000, fallbackFPS: 60, maxFPS: 240, want: 50},
16		{name: "floors very low refresh monitor", refreshMilliHz: 24000, fallbackFPS: 60, maxFPS: 240, want: 30},
17		{name: "hard caps extreme monitor", refreshMilliHz: 500000, fallbackFPS: 60, maxFPS: 240, want: 240},
18	}
19
20	for _, tt := range tests {
21		t.Run(tt.name, func(t *testing.T) {
22			got := adaptiveFrameRateForRefresh(tt.refreshMilliHz, tt.fallbackFPS, tt.maxFPS)
23			if got != tt.want {
24				t.Fatalf("adaptiveFrameRateForRefresh() = %d, want %d", got, tt.want)
25			}
26		})
27	}
28}
29
30func TestIsWaylandDisplayName(t *testing.T) {
31	tests := []struct {
32		name  string
33		input string
34		want  bool
35	}{
36		{name: "exact lowercase", input: "wayland", want: true},
37		{name: "exact uppercase", input: "WAYLAND", want: true},
38		{name: "mixed case", input: "WayLand", want: true},
39		{name: "numeric suffix", input: "wayland-1", want: true},
40		{name: "punctuation suffix", input: "wayland:0", want: true},
41		{name: "leading whitespace", input: " wayland ", want: true},
42		{name: "substring", input: "mywayland-display", want: true},
43		{name: "x11", input: "x11", want: false},
44		{name: "empty", input: "", want: false},
45		{name: "whitespace", input: "   ", want: false},
46	}
47	for _, tt := range tests {
48		t.Run(tt.name, func(t *testing.T) {
49			if got := isWaylandDisplayName(tt.input); got != tt.want {
50				t.Fatalf("isWaylandDisplayName(%q) = %v, want %v", tt.input, got, tt.want)
51			}
52		})
53	}
54}

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