Fast radio bursts (FRBs) are astronomical transients with millisecond timescales occurring at cosmological distances. The observed time lag between different energies of each FRB is well described by the inverse-square law of the observed frequency, i.e., dispersion measure. Therefore, FRBs provide one of the ideal laboratories to test Einstein's weak equivalence principle (WEP): the hypothetical time lag between photons with different energies under a gravitational potential. If WEP is violated, such evidence should be exposed within the observational uncertainties of dispersion measures, unless the WEP violation also depends on the inverse-square of the observed frequency. In this work, we constrain the difference of gamma parameters ($\mathrm{\ensuremath{\Delta}}\ensuremath{\gamma}$) between photons with different energies using the observational uncertainties of FRB dispersion measures, where $\mathrm{\ensuremath{\Delta}}\ensuremath{\gamma}=0$ for Einstein's general relativity. Adopting the averaged `Shapiro time delay' for cosmological sources, FRB 121002 at $z=1.6\ifmmode\pm\else\textpm\fi{}0.3$ and FRB $180817.\mathrm{J}1533+42$ at $z=1.0\ifmmode\pm\else\textpm\fi{}0.2$ place the most stringent constraints of $\mathrm{log}\mathrm{\ensuremath{\Delta}}\ensuremath{\gamma}<\ensuremath{-}20.8\ifmmode\pm\else\textpm\fi{}0.1$ and $\mathrm{log}(\mathrm{\ensuremath{\Delta}}\ensuremath{\gamma}/{r}_{E})<\phantom{\rule{0ex}{0ex}}\ensuremath{-}20.9\ifmmode\pm\else\textpm\fi{}0.2$, respectively, where ${r}_{E}$ is the energy ratio between the photons. The former is about three orders of magnitude lower than those of other astrophysical sources in previous works under the same formalization of the Shapiro time delay while the latter is comparable to the tightest constraint so far.