MCPcopy
hub / github.com/moonD4rk/HackBrowserData / TestRetrieversFromKeys

Function TestRetrieversFromKeys

browser/keydump_test.go:251–266  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

249}
250
251func TestRetrieversFromKeys(t *testing.T) {
252 r := retrieversFromKeys(masterkey.MasterKeys{V10: []byte("k10"), V20: []byte("k20")})
253
254 if r.V10 == nil || r.V20 == nil {
255 t.Fatal("V10 and V20 retrievers should be set from non-empty keys")
256 }
257 if r.V11 != nil {
258 t.Error("V11 retriever should be nil when the key is absent")
259 }
260 if got, _ := r.V10.RetrieveKey(masterkey.Hints{}); string(got) != "k10" {
261 t.Errorf("V10 key = %q, want k10", got)
262 }
263 if got, _ := r.V20.RetrieveKey(masterkey.Hints{}); string(got) != "k20" {
264 t.Errorf("V20 key = %q, want k20", got)
265 }
266}
267
268// makeUserData writes a minimal Chromium profile tree: a Preferences marker plus History (a real
269// extraction source, so the profile resolves) under each named profile dir.

Callers

nothing calls this directly

Calls 5

retrieversFromKeysFunction · 0.85
FatalMethod · 0.80
ErrorMethod · 0.80
ErrorfMethod · 0.80
RetrieveKeyMethod · 0.65

Tested by

no test coverage detected