Index: LayoutTests/fast/js/Promise-static-every.html |
diff --git a/LayoutTests/fast/js/Promise-static-every.html b/LayoutTests/fast/js/Promise-static-every.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..97f5b43527ce8206acb283cb6b174f31fb5996c3 |
--- /dev/null |
+++ b/LayoutTests/fast/js/Promise-static-every.html |
@@ -0,0 +1,62 @@ |
+<!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; |
+result = undefined; |
+ |
+var p1 = Promise.fulfill('p1'); |
+var p2 = Promise.fulfill('p2'); |
+var p3 = Promise.fulfill('p3'); |
+var p4 = new Promise(function(){}); |
+var p5 = new Promise(function(){}); |
+var p6 = Promise.reject('p6'); |
+var p7 = Promise.reject('p7'); |
+ |
+var pp0 = Promise.every().then(function (result) { |
+ debug('PASS Promise.every() is fulfilled.'); |
+ window.result = result; |
+ shouldBe('result', 'undefined'); |
+}, function() { |
+ debug('FAIL Promise.every() is rejected.'); |
+}); |
+ |
+var pp1 = Promise.every(p1, p2, p3).then(function (result) { |
+ debug('PASS Promise.every(p1, p2, p3) is fulfilled.'); |
+ window.result = result; |
+ shouldBe('result.length', '3'); |
+ shouldBeEqualToString('result[0]', 'p1'); |
+ shouldBeEqualToString('result[1]', 'p2'); |
+ shouldBeEqualToString('result[2]', 'p3'); |
+}, function () { |
+ debug('FAIL Promise.every(p1, p2, p3) is rejected.'); |
+}); |
+ |
+var pp2 = Promise.every(p1, p2, p5).then(function (result) { |
+ debug('FAIL Promise.every(p1, p2, p5) is fulfilled.'); |
+}, function () { |
+ debug('FAIL Promise.every(p1, p2, p5) is rejected.'); |
+}); |
+ |
+var pp3 = Promise.every(p1, p6, p7).then(function (result) { |
+ debug('FAIL Promise.every(p1, p6, p7) is fulfilled.'); |
+}, function (result) { |
+ debug('PASS Promise.every(p1, p6, p7) is rejected.'); |
+ window.result = result; |
+ shouldBeEqualToString('result', 'p6'); |
+}); |
+ |
+shouldBe("result", "undefined"); |
+Promise.every(pp0, pp1, pp3).then(finishJSTest, finishJSTest); |
+ |
+</script> |
+<script src="resources/js-test-post.js"></script> |
+</body> |
+</html> |