Autofocus systems look for lines. They move the focus of the lens as long as the line is becoming sharper. When the line dulls, the autofocus system winds the lens back and you have your focus.
Imagine you were doing this with a manual camera that had a split-horizon focusing screen. How would you know when you were in focus if you couldn't see any distinction between the top and bottom halves of the focusing screen because they're both just white?
Also of interest: focusing points on autofocus cameras tend to have 3 distinct capabilities: horizontal, vertical, and diagonal lines. The center element can usually handle all three, but on multiple focus point cameras, you will often find the other points can only handle one or two of those line types.
To take your photo, I suggest these possible options:
- Tape something to the wall, a string, whatever. Focus on it, then switch to manual focus and take away your string.
- Use an autofocus light aid. Canon Speedlites, for example, project a pattern of red lights in lines and focus based on those. You can use one of them, or you can strap a piece of paper with the edge blocking half of a flashlight beam. Laser pointers may also possibly work.
- Manually focus based on range marks on your camera lens.