In this paper we study the possibility of testing Charge-Parity-Time Reversal (CPT) symmetry with cosmic microwave background (CMB) experiments. We consider two kinds of Chern-Simons (CS) term, electromagnetic CS term and gravitational CS term, and study their effects on the CMB polarization power spectra in detail. By combining current CMB polarization measurements, the seven-year WMAP, BOOMERanG 2003 and BICEP observations, we obtain a tight constraint on the rotation angle Delta alpha = -2.28 +/- 1.02 deg (1 sigma), indicating a 2.2 sigma detection of the CPT violation. Here, we particularly take the systematic errors of CMB measurements into account. After adding the QUaD polarization data, the constraint becomes -1.34 < Delta alpha < 0.82 deg at 95% confidence level. When comparing with the effect of electromagnetic CS term, the gravitational CS term could only generate TB and EB power spectra with much smaller amplitude. Therefore, the induced parameter epsilon can not be constrained from the current polarization data. Furthermore, we study the capabilities of future CMB measurements, Planck and CMBPol, on the constraints of Delta alpha and epsilon. We find that the constraint of Delta alpha can be significantly improved by a factor of 15. Therefore, if this rotation angle effect can not be taken into account properly, the constraints of cosmological parameters will be biased obviously. For the gravitational CS term, the future Planck data still can not constrain epsilon very well, if the primordial tensor perturbations are small, r < 0.1. We need the more accurate CMBPol experiment to give better constraint on epsilon.