robolectric/robolectric — pull request #714 by erichaugh (2013-09-25 17:25:41+00:00)
Title: Fix bug so that when a CheckBox, Switch, or ToggleButton is clicked, its state is toggled.

When observing this code running in a debugger, for a CheckBox at least, I saw that the real android code already toggles the state, so the extra call to toggle() is wrong.

I added tests for two other subclasses of CompoundButton, Switch and ToggleButton, which verified that this also fixes the same problem for them.

RadioButtonTest tests performClick() for RadioButton, and it still passes after this change, so this shouldn't break RadioButton, hence I believe this change is correct for all subclasses of CompoundButton.