Power consumption

USB 2.0 Specification, Section 7.1.2 & 7.1.5
USB 3.0 Specification, Section 9.2.5.1
In order to measure the power distribution of a USB device, the average current is measured during unconfigured, configured, active and suspend state with a digital multimeter and fixture to measure the Vbus current . The circumstances for measuring the average current are dependent on the speed of the device and the power mode the device is in (e.g. self powered, bus powered or battery charging capabilities). All High Speed measurements are performed by connecting the device under test after one self-powered High Speed hub. A Full Speed self-powered hub is connected to the first High Speed hub in order to force a High Speed device under test to enter its Full Speed mode.Beware that according to USB 2.0 Spec Vbus should stay between 4.75V and 5.25V - so this means that the worst case current will be measured at 5.25V.

Speed conditions
For a High Speed device the average current is measured in High Speed and Full Speed mode. For a Full Speed device the average current is measured in Full Speed mode. For a Low Speed device the average current is measured in Low Speed mode. A Super Speed device is measured in Super Speed and High Speed mode.

Power conditions
A device should also be measured using the supported power mode in the following circumstances:
1) When a device is only capable of operating in self-powered mode, all measurements are per formed in self-powered mode. This means that the device is unable to enumerate without being connected to an external power.
2) When a device is capable in operating in bus-powered mode, all measurements are performed in bus powered mode even when the device claims to be self-powered (in its device descriptor).
3) When a device has battery-charging capabilities over USB, the power measurements are performed in worst case scenario, most probably this is when the product has a dead battery.

Unconfigured current
The USB 2.0 device under test is set in unconfigured state by using the tool USB20CV. The USB 2.0 unconfigured current must remain below 100mA at all times. For a USB 3.0 device the unconfigured state can be force by using USB30CV. A USB 3.0 device may consume 150mA in unconfigures state. The unconfigured current is measured in the above conditions.

Configured current
The device under test is set in configured state by using the tool for USB2.0 USB20CV and for USB3.0  USB30CV. In this state the configured current is measured in the above conditions. The configured current must remain below the value defined in the bMaxPower field of the descriptor and may never exceed the maximum allowed 500mA for a USB 2.0 device and 900mA for a USB 3.0 device. However there are devices that may consume more than the 500mA or 900mA when following the battery charging specifications.  

Active current
The device under test is operating correctly and during operation, the device current is measured using the above conditions. The active current must remain below the value defined in the bMaxPower field of the descriptor. Make sure that the current is measured in worst-case power consumption mode.

Suspend current
After the device under test is correctly enumerated the host system is placed in Suspend S3 Mode. When the device supports remote wakeup, the remote wakeup feature must be enabled during measurement. The USB 2.0 spec allows a maximum suspend current of 2.5mA. In general the suspend current is the most difficult requirement to meet.
Note that bus powered compound device (internal USB hub with embedded devices) may consume 2.5mA for the internal hub plus 2.5mA for each compounded device. (maximum 4 ports = 12.5mA)