Local elections were seen as major test for the pro-Beijing government after nearly half a year of demonstrations.