There was a bug in IE (I can't remember where) that required us to manually manipulate the focus of an element in order to retain the selection when the user clicked off to a popup dialog. It couldn't be unit-tested because it relied on a quirk in the way a version of IE handled native focus.

We are using the API to manipulate the selection, but we don't actually care that much about the API. We care about the fact that when a user clicks and drags their mouse, the correct thing happens and the selection API is the best way we have to test that. We're simulating the mouse clicks and such that would cause the selection to move to where we say it should move.