Files
camoufox/tests
Jake WriterandClaude Opus 5 1ae5baef6c test(touchscreen): replace the reconstructed reference with the real capture
The reference values were reconstructed, because the recording sat on the
Windows reference box and was not reachable when the guard was written. It is
now read from that machine, so the table is the measured article.

The reconstruction had the right values but the wrong *set*. Of the sixteen
static signals it listed, fourteen matched the capture exactly. The other two
were invented -- `'ontouchstart' in document` and `... in documentElement`,
both false, both harmless -- and they stood in for two real signals that were
missed entirely:

  document.createTouch  false. Gated by TouchEvent::LegacyAPIEnabled, the same
    gate as ontouchstart, so a real touchscreen laptop exposes TouchEvent while
    createTouch stays absent.
  window.PointerEvent   true, and not gated on a digitizer at all. Pinned so it
    cannot start varying.

Both were verified against this build before being written down: it reports
false and true respectively, so the fingerprint matches the device on all
sixteen signals, not merely on the fourteen that were guessed correctly. The
two invented signals are kept as informational output, since nothing measured
backs them.

Captured with tests/assets/touch-reference.html, added here so the recording
can be reproduced on another device: it renders the sixteen static signals plus
an input-event log as JSON. The source device was a Dell XPS 15 9510 on
Firefox 152.0 (Windows NT 10.0, Win64, Win32, 1382x864 @ dpr 2.5), whose
capture also carried 284 input events that this guard does not assert on.

Still fails on a binary without the fix -- now 12/16 rather than 13/16, since
the recorded set no longer includes the two invented always-false signals.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01W2RfR387Mh1JhZ9LZvkptP
2026-09-05 18:51:23 -06:00
..
2024-11-03 06:14:39 -06:00
2024-11-03 06:14:39 -06:00
2024-11-03 06:14:39 -06:00
2024-11-03 06:14:39 -06:00
2024-11-03 06:14:39 -06:00
2024-11-03 06:14:39 -06:00
2024-11-03 06:14:39 -06:00
2024-11-03 06:14:39 -06:00
2024-11-03 06:14:39 -06:00

Camoufox Tests

Ensures that Playwright functionality is not broken.


This directory is based on the original Playwright-Python tests.

It has been modified to skip tests that use the following features:

  • Injecting JavaScript into the page or writing to DOM. Camoufox's page.evaluate only supports reading values, not executing within the page context.
  • Overriding the User-Agent.
  • Any tests specific to Chromium or Webkit.

Usage

Setting up the environment

Cd to this directory and run the following command to setup the venv and install the dependencies:

bash setup-venv.sh

Running the tests

Run via the shell script:

bash run-tests.sh --headful --executable-path /path/to/camoufox-bin

Or through the Makefile:

make tests headful=true