There are 2 more issues.
The test fails on windows 7 with the Aero theme that uses an animation to show a window. So after the toolkit.realSync() when it is supposed that a window is shown it takes some time for the window animation.
It seems it could take some time to show the window on Mac OS X also.
So the robot.delay() method should be added after the window creation in this cases.
The test also fails on Mac OS X with the calibrated display colors.
In this case the test need to be executed on the Mac OS X only with the