If all white people in the US had voted for McCain instead of Obama, Obama would've lost. Literally impossible for there to be any other outcome.
Well, that statement is only relevant if you assume that all white people are racists, which I think is absurd.
I don't claim either side of that question, but I just have to say that your statement is patently false.
Hypothetically all racists could vote one way, and still lose an election (or turn the tides), depending on the size of that group.