1console.log(Promise);
2
3function test_setTimeout() {
4    return new Promise(function (resolve, reject) {
5        console.log('=================setTimeout');
6        setTimeout(function () {
7            console.log('=================setTimeout---------------done');
8            resolve("");
9        }, 1000);
10    });
11}
12
13function test_http() {
14    return new Promise(function (resolve, reject) {
15        console.log('=================http');
16        HTTP.request("http://appengine.oss-cn-hangzhou.aliyuncs.com/httpTest.txt", function(data){
17            resolve(data);
18        });
19    });
20}
21
22test_setTimeout()
23.then(function(){
24    // setInterval异步测试返回
25    return test_http();
26})
27.then(function(data){
28    // http异步测试返回
29    console.log("接收到 HTTP 数据:", data);
30});