robolectric/robolectric — pull request #1418 by tec27 (2014-12-10 00:58:31+00:00)
Title: Call the real onKeyUp code in ShadowActivity#onKeyUp.

Prior to this change, onKeyUp had a simplified copy of Activity#onKeyUp
which neglected to check whether the KeyEvent was being tracked (which
could result in divergent behavior in tests). It also called
onBackPressed directly which, due to how Robolectric's bytecode
replacement works, called directly to ShadowActivity#onBackPressed
rather than moving through the proper class hierarchy. In effect, this
meant that if an Activity had its own implementation of onBackPressed,
this implementation would be ignored and ShadowActivity's would be used
instead.

Changes include a modification to the onKeyUp -> onBackPressed test
to make it use real KeyEvent dispatch and check that the proper
onBackPressed call chain is preserved.