Skip to content

test(cmd): add Firefox and Safari extract goldens - #658

Merged
moonD4rk merged 1 commit into
refactor/main-v2from
refactor/v2-10-ff-safari-goldens
Oct 28, 2026
Merged

moonD4rk merged 1 commit into
refactor/main-v2from
refactor/v2-10-ff-safari-goldens

Conversation

@moonD4rk

Copy link
Copy Markdown
Owner

Phase 6, step 1 of 4 (RFC-012): lock today's Firefox and Safari output before their parsers move.

What

  • New cmd fixtures, built in t.TempDir() like the Chromium one:
    • Firefox: a profiles dir with two profiles, each with its own key4.db, plus the non-profile entries a Linux profiles dir holds (profiles.ini, Crash Reports). Every category Firefox exports has records.
    • Safari: a ~/Library tree with the default profile and a titled and an untitled named profile from SafariTabs.db, the shared Downloads.plist, the container and legacy cookie jars, WebKit origin stores (first-party, partitioned, and one without localStorage), and both extension plists.
  • New goldens from today's code: extract-firefox-{csv,json,cookie-editor} and extract-safari-{csv,json,cookie-editor}. As for Chromium, the cookie-editor golden holds only cookie.json.
  • The goldens record today's bookmark bugs (Firefox folder always url, type empty, id 0; Safari IDs repeat per folder). Step 4 fixes them as a listed golden diff.
  • The Safari test points HOME at the fixture, so no real login keychain is read and Safari exports no passwords here.
  • TestExtractGolden, TestPipelineGolden, and the two new tests share one per-format golden loop. The file and SQLite helpers move from the Chromium fixture to fixture_test.go.

Test-only: no production code changes, and the existing goldens are unchanged.

Tests

  • go test ./... and golangci-lint run pass locally; GOOS=linux and GOOS=windows vet pass.
  • The new goldens are stable over repeated runs (-count=5).

Phase 6 moves the Firefox and Safari parsers, so today's output is locked
first, as the Chromium goldens were before Phase 5.
@moonD4rk
moonD4rk merged commit bc59bd5 into refactor/main-v2 Oct 28, 2026
9 checks passed
@moonD4rk
moonD4rk deleted the refactor/v2-10-ff-safari-goldens branch October 28, 2026 03:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant