We study the cosmological evolution of frequency of a standing electromagnetic wave in a resonant optical cavity placed to the expanding manifold described by the Robertson-Walker metric. Because of the Einstein principle of equivalence (EEP), one can find a local coordinate system (a local freely falling frame), in which spacetime is locally Minkowskian. However, due to the conformal nature of the Robertson-Walker metric the conventional transformation to the local inertial coordinates introduces ambiguity in the physical interpretation of the local time coordinate, X 0 . Therefore, contrary to a common-sense expectation, a straightforward implementation of EEP alone does not allow us to unambiguously decide whether atomic clocks based on quantum transitions of atoms, ticks at the same rate as the clocks based on electromagnetic modes of a cavity. To resolve this ambiguity we have to analyse the cavity rigidity and the oscillation of its electromagnetic modes in an expanding universe by employing the full machinery of the Maxwell equations irrespectively of the underlying theory of gravity. We proceed in this way and found out that the size of the cavity and the electromagnetic frequency experience an adiabatic drift in conformal (unphysical) coordinates as the universe expands in accordance with the Hubble law. We set up the oscillation equation for the resonant electromagnetic modes, solve it by the WKB approximation, and reduce the coordinate-dependent quantities to their counterparts measured by a local observer who counts time with atomic clock. The solution shows that there is a perfect mutual cancellation of the adiabatic drift of cavity's frequency by space transformation to local coordinates and the time counted by the clocks based on electromagnetic modes of cavity has the same rate as that of atomic clocks. We conclude that if general relativity is correct and the local expansion of space is isotropic Department of Physics & Astronomy, University of Missouri, 322 Physics Bldg., Columbia, MO 65211, USA; Siberian State Geodetic Academy, 10 Plakhotny St., Novosibirsk 630108, Russia E-mail: kopeikins@missouri.edu 2 there should be no cosmological drift of frequency of a standing electromagnetic wave oscillating in the cavity resonator as compared to the frequency of atomic clocks. Continuous comparison of the frequency of the optical cavity resonator against that of atomic clock yields a powerful null test of the local isotropy of the Hubble expansion and the Einstein equivalence principle in cosmology.