Bug 919370 - [Test][Keyboard] Unit test for Pinyin IME

- also modified the latin and suggest unit test to prevent the conflict of global variables