sleep for 1 seconds might be unnecessary since the onPageFinished called on UI thread ensures the title is updated.

Have a look at 'XWalkViewTestBase.loadDataSync', you will find that this method would wait for the callback onPageFinished to be called, or timeout and throw exception.