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

Function TestBuildDump_SingleChromium

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

Source from the content-addressed store, hash-verified

87}
88
89func TestBuildDump_SingleChromium(t *testing.T) {
90 b := &mockChromiumBrowser{
91 mockBrowser: mockBrowser{name: chromeName, userDataDir: testUDD, profiles: []string{testProfileDefault}},
92 keys: masterkey.MasterKeys{V10: []byte("v10-key")},
93 }
94
95 dump := BuildDump([]Browser{b})
96
97 if len(dump.Vaults) != 1 {
98 t.Fatalf("Vaults len = %d, want 1", len(dump.Vaults))
99 }
100 inst := dump.Vaults[0]
101 if !strings.EqualFold(inst.Browser, chromeName) || inst.UserDataDir != testUDD {
102 t.Errorf("inst metadata = %+v", inst)
103 }
104 if inst.Kind != "chromium" {
105 t.Errorf("Kind = %q, want chromium", inst.Kind)
106 }
107 if len(inst.Profiles) != 1 || inst.Profiles[0] != testProfileDefault {
108 t.Errorf("Profiles = %v", inst.Profiles)
109 }
110 if string(inst.Keys.V10) != "v10-key" {
111 t.Errorf("Keys.V10 = %q", inst.Keys.V10)
112 }
113}
114
115// TestBuildDump_MultipleProfilesOneVault verifies that one installation holding
116// multiple profiles produces a single vault with all profile names, deriving the

Callers

nothing calls this directly

Calls 3

BuildDumpFunction · 0.85
FatalfMethod · 0.80
ErrorfMethod · 0.80

Tested by

no test coverage detected