The exercise involved the military police, with 50 of them playing the part of unruly protesters.
A helicopter monitored the "march" next to Rio's Sambadrome in order to inform the actions of agents on the ground.
After fresh violent street unrest, the Brazilian government recently announced plans to deploy up to 170,000 security personnel during the World Cup.
President Dilma Rousseff said the armed forces could also be brought in if needed.
Since last June, protesters have staged a number of street marches, with some violent episodes, raising concerns about security at the tournament.
Brazil is also preparing to host the 2016 Olympics in Rio de Janeiro.
But the focus is now on the World Cup, which kicks off on 12 June.
Police admit they were caught by surprise by the large demonstrations which took place last year during the warm-up tournament Confederations Cup.
More than a million people took to the streets to protest against corruption and excessive spending on preparations for the World Cup and the Olympics
"We learned that each day is a continued process of learning for all of us. The Confederations Cup was a laboratory for the World Cup and even later for the Olympics," the commander of Rio's riot police, Colonel Andre Luiz Vidal, told Efe news agency.
Earlier this month, a cameraman died after being hit by fireworks apparently let off by protesters.
Riot police in Rio de Janeiro have undergone training in crowd control ahead of the Brazil football World Cup.