How do service stores determine capacity in a lithium battery?
The phone is Coulomb-counting all the time. It keeps track of all the charge it puts into the battery and all the charge it gets out, correlates against the cell voltage, and uses that information to constantly update its own estimate of the usable battery capacity (with an appropriate amount of filtering, of course, so that one noisy reading doesn't throw everything off). When you go into the shop, they don't have to test anything directly; they just ask your phone to hand over the number that it already has somewhere in memory.