# 测试用 Local State fixture `Local State.sample.json` 是**完全人工构造**的样本文件,不是从任何真实 Chrome 安装脱敏而来—— 所有 `gaia_id`、姓名、邮箱、头像 URL 等字段都是占位符(`test.user.one@example.com` 之类), 不包含任何真实账号信息,可以放心提交到仓库、拿去别的机器测试。 结构上覆盖了 `profile.info_cache` 的三种场景,用来验证 `install.sh` / `install.ps1` 对每个 profile 的处理是否正确: | profile | 初始状态 | 用来验证什么 | |---|---|---| | `Default` | 完全没有 `is_glic_eligible` 字段 | 插入逻辑 | | `Profile 1` | `is_glic_eligible: false` | 翻转逻辑 | | `Profile 2` | `is_glic_eligible: true` | 已生效时保持不变、不产生重复 key | 顶层也没有 `variations_country` / `variations_permanent_consistency_country`,用来验证插入逻辑。 ## 在 Windows 上测试 install.ps1 1. 先备份你自己真实的 Local State(如果要在真实 Chrome 目录下测): ```powershell Copy-Item "$env:LOCALAPPDATA\Google\Chrome\User Data\Local State" "$env:LOCALAPPDATA\Google\Chrome\User Data\Local State.real.bak" ``` 2. 把这份 fixture 拷贝过去顶替(**记得测完要恢复**): ```powershell Copy-Item ".\test-fixtures\Local State.sample.json" "$env:LOCALAPPDATA\Google\Chrome\User Data\Local State" ``` 3. 运行 `..\install.ps1`,检查输出里三个 profile 是否都提示 `is_glic_eligible` 已启用。 4. 测完恢复真实文件: ```powershell Copy-Item "$env:LOCALAPPDATA\Google\Chrome\User Data\Local State.real.bak" "$env:LOCALAPPDATA\Google\Chrome\User Data\Local State" -Force ``` 也可以不碰真实路径,直接改一份 `install.ps1` 的副本把 `$chromeStatePath` 硬编码指向这份 fixture,跑完直接看输出文件内容,更安全、不依赖"记得恢复"这一步。