TestRunBrowserBootstrap_TokenEmpty — file exists but is empty (0 bytes or only whitespace). EnsureBootstrapToken would never produce this, but a corrupted file or partial write deserves a clear error rather than silently building a `#token=` URL with an empty token.
(t *testing.T)
| 165 | // a corrupted file or partial write deserves a clear error rather than |
| 166 | // silently building a `#token=` URL with an empty token. |
| 167 | func TestRunBrowserBootstrap_TokenEmpty(t *testing.T) { |
| 168 | srv := fakeSessionServer(t, func() SessionResponse { |
| 169 | return SessionResponse{SetupRequired: true, SetupMethod: "logs_token"} |
| 170 | }) |
| 171 | cfg := newTestConfig(t, srv.URL) |
| 172 | writeBootstrapToken(t, cfg.DataDir, " ") |
| 173 | |
| 174 | client := NewClientFromURL(srv.URL) |
| 175 | err := RunBrowserBootstrap(context.Background(), client, cfg, "") |
| 176 | if err == nil { |
| 177 | t.Fatal("RunBrowserBootstrap returned nil with empty token, want error") |
| 178 | } |
| 179 | if !strings.Contains(err.Error(), "empty") { |
| 180 | t.Errorf("error %q should call out empty token", err.Error()) |
| 181 | } |
| 182 | } |
| 183 | |
| 184 | // TestRunBrowserBootstrap_LocalCLIMethod — the server failed to provision |
| 185 | // a bootstrap token (read-only DataDir, etc.) and the bypass flag isn't |
nothing calls this directly
no test coverage detected