Wheeler's delayed-choice experiment investigates the indeterminacy of wave-particle duality and the role played by the measurement apparatus in quantum theory. Due to the inconsistency with classical physics, it has been generally believed that it is not possible to reproduce the delayed-choice experiment using a hidden variable theory. Recently, it was shown that Wheeler's delayed-choice experiment can be explained by a causal two dimensional hidden-variable theory [R. Chaves, G. B. Lemos, and J. Pienaar, Phys. Rev. Lett. 120, 190401 (2018)]. Here, we carry out a delayed-choice experiment by using photon states that are space-like separated, and demonstrate that the experiment is consistent with quantum theory but inconsistent with any causal twodimensional hidden variable theory in a device-independent manner. This demonstrates that causality can be used to test quantum theory in a complementary way to the Bell and Leggett-Garg tests.