Test of the all-optical control of wave-particle duality of cavity photons by ordinary photodetection