My headlights did this exact same thing just last week. I didn't test anything, I just went out and bought a new headlight switch. I know that you said you tested it and it was good but maybe you should check again.
I mean, my headlights did the EXACT same thing (parking lamps, brights...