refactor: merge the browser tables into internal/browser (#654)

One Def per browser carries every OS's user data dirs, keychain label, and Windows ABE target,
so the per-OS lists and the abeTargets join go away and today's configs derive from it;
a test parsing com_iid.c keeps the payload's table in step with the ABE rows.
This commit is contained in:
Roger authored and GitHub committed 2026-10-27 16:06:57 +08:00
1 parent 0b8cc23216
commit b655afd054
17 files changed
+432 -424

No files matched your search

+1 -1
View File
@@ -135,7 +135,7 @@ For a genuinely new base (not Chromium/Firefox/Safari), you add a new `internal/
## Consistency, enforced by tests
Folding `winutil.Table` into `Platform` removes the Go-side join, and with it the need for today's `TestWinUtilTableCoversABEBrowsers`: one struct cannot disagree with itself. What remains is the C side — the payload runs inside the browser process with no Go runtime, so its table stays in `com_iid.c`. A Go test inside `browser`, over the whole table, parses that file and fails when its set of executables and ABE kinds differs from the Windows entries whose `ABE` is not `ABENone` ([RFC-011](011-testing-and-quality.md)). A mismatch fails `go test`, not production.
Folding `winutil.Table` into `Platform` removes the Go-side join, and with it the need for today's `TestWinUtilTableCoversABEBrowsers`: one struct cannot disagree with itself. What remains is the C side — the payload runs inside the browser process with no Go runtime, so its table stays in `com_iid.c`. A Go test inside `browser`, over the whole table, parses that file and fails when a Windows entry whose `ABE` is not `ABENone` has no row there with the same executable and ABE kind; the C table may list browsers the Go table does not, such as Avast ([RFC-011](011-testing-and-quality.md)). A mismatch fails `go test`, not production.
## Why a table beats per-browser types
+1 -1
View File
@@ -63,7 +63,7 @@ Each bug designed out by this rewrite gets a test that would have caught it, so
## Table and payload consistency
- Every key in the Chromium override table resolves through `browser.Lookup` to a Chromium `Def`.
- The table's Windows rows with `ABE` other than `ABENone` and the rows of the payload's `com_iid.c` name the same executables and ABE kinds; the test parses the C table. It lives inside `browser` and reads the whole table, since `Supported()` lists only the running OS's rows. (The Go-side `winutil.Table` join, and the `TestWinUtilTableCoversABEBrowsers` that guarded it, disappear into `Platform`.)
- Every Windows row of the table with `ABE` other than `ABENone` has a row in the payload's `com_iid.c` with the same executable and ABE kind; the test parses the C table, which may list browsers the Go table does not, such as Avast. It lives inside `browser` and reads the whole table, since `Supported()` lists only the running OS's rows. (The Go-side `winutil.Table` join, and the `TestWinUtilTableCoversABEBrowsers` that guarded it, disappear into `Platform`.)
## Import direction