Add tests for language name display in ime menu

Some refactoring to make tests more expressive

This commit depends on
I4a6cc9a79f186941cc79533de90ab0fb7e104673

Change-Id: Ib8796525dcdd679f5d78a40db3f561aa537a2096