[Runtime] Polish application browser test

1. Make test API extension running on UI thread. And let the client to return
the xwalk.app.test.notifyPass/Fail callback explicitly when it's ready.
2. Using Promise to provide a common asynchronous test driver. The JS can now
write code like below to test:
  function test1(resolve) { ... } // calls resolve() when test is done
  function test2(resolve) { ... } // calls resolve() when test is done
  var tests = [test1, test2];
  xwalk.app.test.runTests(tests);