2013-06-26 06:44:21 -07:00
|
|
|
<!--
|
|
|
|
Any copyright is dedicated to the Public Domain.
|
|
|
|
http://creativecommons.org/publicdomain/zero/1.0/
|
|
|
|
-->
|
|
|
|
<html>
|
|
|
|
<head>
|
2013-07-11 13:40:36 -07:00
|
|
|
<title>Promise - bug 883683</title>
|
2013-06-26 06:44:21 -07:00
|
|
|
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
|
|
|
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<p id="display"></p>
|
|
|
|
<div id="content" style="display: none">
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<pre id="test">
|
|
|
|
<script type="application/javascript"><!--
|
|
|
|
|
|
|
|
function runTest() {
|
2013-07-11 13:40:36 -07:00
|
|
|
[{}, {}, {}, {}, {}].reduce(Promise.reject);
|
2013-06-26 06:44:21 -07:00
|
|
|
ok(true, "No leaks with reject?");
|
|
|
|
|
2013-07-11 13:40:36 -07:00
|
|
|
[{}, {}, {}, {}, {}].reduce(Promise.resolve);
|
2013-06-26 06:44:21 -07:00
|
|
|
ok(true, "No leaks with resolve?");
|
|
|
|
|
2013-09-11 09:03:04 -07:00
|
|
|
[{}, {}, {}, {}, {}].reduce(function(a, b, c, d) { return new Promise(function(r1, r2) { throw a; }); });
|
2013-06-26 06:44:21 -07:00
|
|
|
ok(true, "No leaks with exception?");
|
|
|
|
|
2013-09-11 09:03:04 -07:00
|
|
|
[{}, {}, {}, {}, {}].reduce(function(a, b, c, d) { return new Promise(function(r1, r2) { }); });
|
2013-07-11 13:40:36 -07:00
|
|
|
ok(true, "No leaks with empty promise?");
|
2013-06-26 06:44:21 -07:00
|
|
|
|
|
|
|
SimpleTest.finish();
|
|
|
|
}
|
|
|
|
|
|
|
|
SimpleTest.waitForExplicitFinish();
|
2014-01-30 13:14:00 -08:00
|
|
|
runTest();
|
2013-06-26 06:44:21 -07:00
|
|
|
// -->
|
|
|
|
</script>
|
|
|
|
</pre>
|
|
|
|
</body>
|
|
|
|
</html>
|