The tests were refactored to drop AWT dependence where it was possible. Reviewed-by: alanb, mchung
Reviewed-by: darcy, weijun