summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/js/Promise-simple-resolve.html
blob: 635b3cd9c29ea1bd21fb81521996ed676083b5a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<!DOCTYPE html>
<html>
<head>
<script src="resources/js-test-pre.js"></script>
</head>
<body>
<div id="description"></div>
<div id="console"></div>
<script>
description('Test Promise.');

window.jsTestIsAsync = true;

var future = new Promise(function(resolve) {
  setTimeout(function() {
    resolve('hello');
  }, 0);
}).then(function(result) {
  window.result = result;
  shouldBeEqualToString('result', 'hello');
  finishJSTest();
});

</script>
</body>
</html>