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)
| 116 | // multiple profiles produces a single vault with all profile names, deriving the |
| 117 | // key exactly once. |
| 118 | func 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 | |
| 137 | func TestBuildDump_SkipsNonKeyManager(t *testing.T) { |
| 138 | chrome := &mockChromiumBrowser{ |