mirror of
https://github.com/moonD4rk/HackBrowserData.git
synced 2026-08-26 00:32:35 +02:00
* feat(restore): cross-platform restore via dump engine rebuild (#606) Restore previously required the dump's origin OS, overlaying keys onto locally-discovered browsers. It now rebuilds Chromium engines from the dump's vaults (v2 adds engine kind), so copied data or an archive zip decrypts on any OS. * fix(restore): polish help text, drop dead check, dedup dump kinds pflag treats backticked words in flag usage as the value placeholder, so --data-zip rendered as "--data-zip archive" in help output.
This commit is contained in:
@@ -237,6 +237,50 @@ func TestNewBrowsers(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// discoverProfiles: fallback boundaries (marker-less copies, flat-layout precedence)
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
func TestDiscoverProfiles(t *testing.T) {
|
||||
t.Run("markerless multi-subdir resolves all source-bearing dirs", func(t *testing.T) {
|
||||
dir := t.TempDir()
|
||||
mkFile(dir, "Default", "History")
|
||||
mkFile(dir, "Profile 1", "History")
|
||||
assert.Len(t, discoverProfiles(dir, chromiumSources), 2)
|
||||
})
|
||||
|
||||
t.Run("marker present keeps fallback dormant", func(t *testing.T) {
|
||||
dir := t.TempDir()
|
||||
mkFile(dir, "Default", "Preferences")
|
||||
mkFile(dir, "Default", "History")
|
||||
mkFile(dir, "NotAProfile", "History")
|
||||
got := discoverProfiles(dir, chromiumSources)
|
||||
require.Len(t, got, 1)
|
||||
assert.Equal(t, filepath.Join(dir, "Default"), got[0])
|
||||
})
|
||||
|
||||
t.Run("skipped dir ignored by markerless fallback", func(t *testing.T) {
|
||||
dir := t.TempDir()
|
||||
mkFile(dir, "System Profile", "History")
|
||||
assert.Empty(t, discoverProfiles(dir, chromiumSources))
|
||||
})
|
||||
|
||||
t.Run("sourceless subdir ignored", func(t *testing.T) {
|
||||
dir := t.TempDir()
|
||||
mkDir(dir, "Crashpad")
|
||||
assert.Empty(t, discoverProfiles(dir, chromiumSources))
|
||||
})
|
||||
|
||||
t.Run("flat-layout root wins over source-bearing subdir", func(t *testing.T) {
|
||||
dir := t.TempDir()
|
||||
mkFile(dir, "History")
|
||||
mkFile(dir, "Subthing", "History")
|
||||
got := discoverProfiles(dir, chromiumSources)
|
||||
require.Len(t, got, 1)
|
||||
assert.Equal(t, dir, got[0], "flat-layout root must win; subdir must not hijack discovery")
|
||||
})
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Test helpers
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user