A horrible thought struck Harry, as horrible thoughts always do when you're very nervous. What if he wasn't chosen at all? What if he just sat there with the hat over his eyes for ages, until Professor McGonagall jerked it off his head and said there had obviously been a mistake and he'd better get back on the train?

Harry Potter and the Philosopher's Stone - Chapter 7 : The Sorting Hat
See this quote in the Pensive -