A reasonable explanation of the measurement of "power" including H.P. is given below - scroll down to the power section.
http://www.projects.ex.ac.uk/trol/dictunit/notes2.htm
I would assume that the little black box calculates the power required to accelerate the car from rest. The little black box is given the mass (kg) of the car. It measures acceleration from rest and time so it can calculate the final speed and distance travelled.Accelerate 2,000kg of metal, skin and bones from 0 - 27.78m/s (100kmph) in 8 seconds...
Acceleration = 27.78/8 = m/s2 = 3.48 m/s2
Distance Travelled S = 0.5at2 = 0.5 x 3.48 x 8.0 x 8.0 = 111.36m
Force = ma = kgm/s2 = 2,000 x 3.48 = 6,960newtons
Work Done = Force x Distance = 6,960 x 111.36 = 775,065.60 Joules
Power = Work Done / Time = 775,065.60 / 8.0 = 96,883.2 Joules / sec = Watts or 96.8832KW where KW is kilowatts.
Convert from KW to HP roughly multiply by 1.34 (obtained off the web)
96.8832kw x 1.34 = 129.83hp
Notice the result did not require any information on rpm or anywhere else. All it needed was the mass kg (input by you), time and the acceleration (calculated by itself).
Now I admit it is years since I did O level physics - but I'm pretty sure this is how the little black box works.
All this gubbins about transmission losses...well it is possible to calculate the energy released by burning petrol and to measure the amount of fuel consumed over several 'runs' by brimming the tank. But this is another story not for today. I should point out that this extra calculation does not calculate the transmission losses, which is only part of the energy 'lost' - the calculation calculates total energy losses including all the hot air escaping out the back and heat transferred away by the radiator! The more subjective bit is deciding what is lost 'in the engine' and 'in the transmission'.
Regards
Les