fix bug 1055870: "Signed in with..." icon is wrong.

@groovecoder adds 43 lines of test code to fix 3 lines of functional code.

See https://bugzilla.mozilla.org/show_bug.cgi?id=1055870#c4 for spot-check instructions.