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

Function TestBuildDump_MultipleProfilesOneVault

browser/keydump_test.go:118–135  ·  view source on GitHub ↗

TestBuildDump_MultipleProfilesOneVault verifies that one installation holding multiple profiles produces a single vault with all profile names, deriving the key exactly once.

(t *testing.T)

Source from the content-addressed store, hash-verified

116// multiple profiles produces a single vault with all profile names, deriving the
117// key exactly once.
118func TestBuildDump_MultipleProfilesOneVault(t *testing.T) {
119 b := &mockChromiumBrowser{
120 mockBrowser: mockBrowser{name: chromeName, userDataDir: testUDD, profiles: []string{testProfileDefault, testProfile1}},
121 keys: masterkey.MasterKeys{V10: []byte("v10")},
122 }
123
124 dump := BuildDump([]Browser{b})
125
126 if len(dump.Vaults) != 1 {
127 t.Fatalf("Vaults len = %d, want 1 (one installation = one vault)", len(dump.Vaults))
128 }
129 if len(dump.Vaults[0].Profiles) != 2 {
130 t.Errorf("Profiles = %v, want both profiles", dump.Vaults[0].Profiles)
131 }
132 if b.calls != 1 {
133 t.Errorf("ExportKeys calls = %d, want 1 (one call per installation)", b.calls)
134 }
135}
136
137func TestBuildDump_SkipsNonKeyManager(t *testing.T) {
138 chrome := &mockChromiumBrowser{

Callers

nothing calls this directly

Calls 3

BuildDumpFunction · 0.85
FatalfMethod · 0.80
ErrorfMethod · 0.80

Tested by

no test coverage detected