What command can testfor a player looking up?
Solution 1:
The selector arguments rx
(X rotation maximum) and rxm
(X rotation minimum) will let you test for a player with a certain vertical rotation. In this case, as -90 is the furthest up you can look, the command you want should be:
/testfor @a[rxm=-90]