The paper introduces a novel Test-Time Domain Generalization (TTDG) framework for Face Anti-Spoofing (FAS) to enhance the model's generalizability to unseen data. Unlike traditional domain generalization (DG) methods that focus on learning domain-invariant features during training, TTDG leverages testing data to improve generalizability without requiring model updates at test time. The framework consists of two key components: Test-Time Style Projection (TTSP) and Diverse Style Shifts Simulation (DSSS). TTSP projects unseen samples into the known source space using a set of learnable style bases, while DSSS synthesizes diverse style shifts in a hyperspherical feature space. The method is model-agnostic and can be integrated into both CNN and ViT backbones. Extensive experiments on cross-domain FAS benchmarks demonstrate the effectiveness and state-of-the-art performance of the proposed TTDG framework.The paper introduces a novel Test-Time Domain Generalization (TTDG) framework for Face Anti-Spoofing (FAS) to enhance the model's generalizability to unseen data. Unlike traditional domain generalization (DG) methods that focus on learning domain-invariant features during training, TTDG leverages testing data to improve generalizability without requiring model updates at test time. The framework consists of two key components: Test-Time Style Projection (TTSP) and Diverse Style Shifts Simulation (DSSS). TTSP projects unseen samples into the known source space using a set of learnable style bases, while DSSS synthesizes diverse style shifts in a hyperspherical feature space. The method is model-agnostic and can be integrated into both CNN and ViT backbones. Extensive experiments on cross-domain FAS benchmarks demonstrate the effectiveness and state-of-the-art performance of the proposed TTDG framework.