Your code looks correct. Are you still having problems with this?
You shouldn't need the Thread.sleep(10) that you have there.
Can you check if shadowOf(context).peekNextStartedService() returns
conn after the call to bindService().
If you have the source of Robolectric attached, maybe set a breakpoint
at your onServiceConnected and check the stack trace in the Shadow*
classes to make sure the parameters you are expecting are being passed
down.
Cheers,
--Aaron V.
--
--Aaron V.
[
http://github.com/avh4 ]