Skip to content

test(chrome): add Windows v10 cookie encryption fixtures#397

Merged
mherod merged 1 commit intomainfrom
feat/windows-test-fixtures
Dec 3, 2025
Merged

test(chrome): add Windows v10 cookie encryption fixtures#397
mherod merged 1 commit intomainfrom
feat/windows-test-fixtures

Conversation

@mherod
Copy link
Owner

@mherod mherod commented Dec 2, 2025

Summary

Add comprehensive Windows-specific test fixtures for Chrome cookie encryption testing.

Changes

  • New Windows v10 encryption fixtures (windowsFixtures.ts)

    • AES-256-GCM encryption/decryption utilities
    • Test keys and constants for deterministic testing
    • Pre-computed test cookies (session, auth, unicode, empty, long values)
    • Error case fixtures for testing invalid scenarios
    • Batch cookie generation utility
    • Format validation utilities
  • Local State file fixtures (localStateFixtures.ts)

    • Mock DPAPI key generation
    • Windows Chrome directory structure creation
    • Invalid Local State test cases
  • Enhanced createTestDatabase.ts

    • Support for v10 (Windows) and v11 (macOS/Linux) encryption formats
    • createWindowsChromeCookieDatabase() convenience function
    • Deterministic mode for reproducible tests
    • Automatic Local State file generation
  • Updated CI workflow (.github/workflows/ci-consolidated.yml)

    • Added retry logic with nick-invision/retry@v2
    • Better Chromium installation verification
    • Improved headless Chrome cookie generation
    • Validation steps for Windows test environment

Tests

  • 52 new tests covering all fixture utilities
  • All tests passing

- Add windowsFixtures.ts with AES-256-GCM encryption/decryption utils
- Add localStateFixtures.ts for Windows DPAPI key testing
- Enhance createTestDatabase.ts with v10/v11 encryption format support
- Add comprehensive test suite (52 tests) for Windows fixtures
- Update CI workflow with retry logic and validation for Windows
@claude
Copy link

claude bot commented Dec 2, 2025

PR Review: Windows v10 Cookie Encryption Fixtures

Overview

This PR adds comprehensive Windows-specific test fixtures for Chrome cookie encryption testing with v10 (AES-256-GCM) format. The implementation is well-structured and follows good testing practices. Overall, this is a solid addition that will improve cross-platform testing capabilities.

Findings

🔵 Suggestions

  • CI Workflow: Programmatic fixture generation (line 333-349): The step attempts to load createTestDatabases from the exported package, but it is marked as continue-on-error with a note that utilities are not exported yet. Consider either exporting these utilities for use in CI, removing this step until ready, or making it clear this is a placeholder for future work.

  • Fixture Design: Mock DPAPI documentation: The mock DPAPI implementation is appropriate for testing, but consider adding a note that these fixtures work cross-platform, cannot be used to test actual DPAPI decryption logic, and are intended for testing the v10 encryption format itself.

  • Type safety: Optional undefined types (localStateFixtures.ts line 105, 361): Several return types explicitly include undefined. The question mark already makes it optional, so the undefined union is redundant.

💭 Questions

  • Test Coverage: Are there integration tests that use these fixtures with the actual Chrome cookie extraction code to verify the v10 decryption works end-to-end?

  • CI Windows Tests: Will the actual test suite now run Windows-specific tests using these fixtures, or are these fixtures primarily for local development?

👍 What's Good

  • Excellent documentation with comprehensive JSDoc comments
  • Deterministic testing support for reproducible tests
  • Comprehensive error case coverage
  • Strong TypeScript types throughout
  • Good separation of concerns across fixture files
  • CI improvements with retry logic and better verification
  • Helpful format validation utilities

Summary

This is a well-implemented PR that significantly improves the testing infrastructure for Windows Chrome cookie encryption. The fixtures are thorough, well-documented, and follow good testing patterns.

Recommendation: Approve with minor suggestions. None are blocking issues. The main item to consider is clarifying the intent of the programmatic test fixtures CI step.

Copy link

@claude claude bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! This is a well-implemented PR with comprehensive Windows v10 encryption fixtures. The code is well-documented, type-safe, and follows good testing patterns. I've left some minor suggestions in a separate comment, but none are blocking. Great work on the thorough test coverage and CI improvements.

@mherod mherod merged commit 451e16e into main Dec 3, 2025
26 checks passed
@mherod mherod deleted the feat/windows-test-fixtures branch December 3, 2025 00:37
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