Promise Tests

This test demonstrates the use of promise_test. Assumes ECMAScript 6 Promise support. Some failures are expected.

Summary

Harness status: OK

Found 12 tests

Details

ResultTest NameMessage
PassPromises are supported in your browser
Asserts run
Pass
assert_true(true)
    at Test.<anonymous> ( /resources/test/tests/functional/promise.html:17:9)
Pass
assert_equals("function", "function")
    at Test.<anonymous> ( /resources/test/tests/functional/promise.html:18:9)
Pass
assert_equals("function", "function")
    at Test.<anonymous> ( /resources/test/tests/functional/promise.html:19:9)
PassPromise fulfillment with result
Asserts run
Pass
assert_equals("x", "x", "Fulfilled promise should pass result to fulfill reaction.")
    at  /resources/test/tests/functional/promise.html:28:21
PassPromise rejection with result
Asserts run
Pass
assert_true(true, "Rejected promise should pass reason to fulfill reaction.")
    at  /resources/test/tests/functional/promise.html:41:21
Pass
assert_equals("fail", "fail", "Rejected promise should pass reason to reject reaction.")
    at  /resources/test/tests/functional/promise.html:44:21
PassChain of promise resolutions
Asserts run
Pass
assert_array_equals(["a", "b", "c"], ["a", "b", "c"])
    at  /resources/test/tests/functional/promise.html:69:21
FailAssertion failure in a fulfill reaction (should FAIL with an expected failure)assert_true: Expected failure. expected true got false
    at https://www1.wpt.live/resources/test/tests/functional/promise.html:80:21
Asserts run
Fail
assert_true(false, "Expected failure.")
    at  /resources/test/tests/functional/promise.html:80:21
Failunreached_func as reactor (should FAIL with an expected failure)assert_unreached: Expected failure. Reached unreachable code
Error
    at get_stack (https://www1.wpt.live/resources/testharness.js:4567:21)
    at new AssertionError (https://www1.wpt.live/resources/testharness.js:4560:22)
    at assert (https://www1.wpt.live/resources/testharness.js:4544:19)
    at assert_unreached (https://www1.wpt.live/resources/testharness.js:2392:10)
    at Test.<anonymous> (https://www1.wpt.live/resources/testharness.js:2731:13)
    at Test.step (https://www1.wpt.live/resources/testharness.js:2638:25)
    at https://www1.wpt.live/resources/testharness.js:2685:35
Asserts runNo asserts ran
Failpromise_test with function that doesn't return a Promise (should FAIL)promise_test: test body must return a 'thenable' object (received an object with no `then` method)
    at new Promise (<anonymous>)
    at https://www1.wpt.live/resources/testharness.js:737:20
Asserts runNo asserts ran
Failpromise_test with function that doesn't return anythingpromise_test: test body must return a 'thenable' object (received undefined)
    at new Promise (<anonymous>)
    at https://www1.wpt.live/resources/testharness.js:737:20
Asserts runNo asserts ran
Failpromise_test that returns a non-thenable (should FAIL)promise_test: test body must return a 'thenable' object (received an object with no `then` method)
    at new Promise (<anonymous>)
    at https://www1.wpt.live/resources/testharness.js:737:20
Asserts runNo asserts ran
Failpromise_test with unhandled rejection (should FAIL)promise_test: Unhandled rejection with value: "Expected rejection"
Error
    at get_stack (https://www1.wpt.live/resources/testharness.js:4567:21)
    at new AssertionError (https://www1.wpt.live/resources/testharness.js:4560:22)
    at assert (https://www1.wpt.live/resources/testharness.js:4544:19)
    at Test.<anonymous> (https://www1.wpt.live/resources/testharness.js:764:29)
    at Test.step (https://www1.wpt.live/resources/testharness.js:2638:25)
    at https://www1.wpt.live/resources/testharness.js:2685:35
Asserts runNo asserts ran
Failpromise_test with unhandled exception in fulfill reaction (should FAIL)promise_test: Unhandled rejection with value: object "Error: Expected exception."
Error
    at get_stack (https://www1.wpt.live/resources/testharness.js:4567:21)
    at new AssertionError (https://www1.wpt.live/resources/testharness.js:4560:22)
    at assert (https://www1.wpt.live/resources/testharness.js:4544:19)
    at Test.<anonymous> (https://www1.wpt.live/resources/testharness.js:764:29)
    at Test.step (https://www1.wpt.live/resources/testharness.js:2638:25)
    at https://www1.wpt.live/resources/testharness.js:2685:35
Asserts runNo asserts ran
Failpromise_test with unhandled exception in reject reaction (should FAIL)promise_test: Unhandled rejection with value: object "Error: Expected exception."
Error
    at get_stack (https://www1.wpt.live/resources/testharness.js:4567:21)
    at new AssertionError (https://www1.wpt.live/resources/testharness.js:4560:22)
    at assert (https://www1.wpt.live/resources/testharness.js:4544:19)
    at Test.<anonymous> (https://www1.wpt.live/resources/testharness.js:764:29)
    at Test.step (https://www1.wpt.live/resources/testharness.js:2638:25)
    at https://www1.wpt.live/resources/testharness.js:2685:35
Asserts runNo asserts ran