[webapi][XWALK-522] Optimize the test cases for promises