Commit Graph

27 Commits

Author SHA1 Message Date
Rick Waldron 86209d8fd9 Make all harness/* file names consistent; update occurrences in test
Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
2017-06-28 11:53:58 -04:00
Mike Pennisi a61efb5192 Add omitted license information
As the author of these files, I can verify that they were contributed in
2015 on behalf of the V8 project.
2017-04-18 12:23:22 -04:00
André Bargull d59e30c95e Remove execute bit from files (#976) 2017-04-13 16:24:07 -04:00
Kevin Gibbons e6abf652d9 Ensure that tests calling $DONE have the async flag 2016-11-21 10:14:30 -05:00
Mike Pennisi c62700c8ef Assert iterator protocol for Promise methods 2016-06-27 15:26:35 -04:00
Leo Balter 5357b1585b Merge pull request #504 from bocoup/explicit-async
Make asynchronous test configuration explicit
2016-03-17 15:28:08 -04:00
Mike Pennisi 23d566209a Make asynchronous test configuration explicit
For asynchronous tests, the contract between test file and test runner
is implicit: runners are expected to inspect the source code for
references to a global `$DONE` identifier.

Promote a more explicit contract between test file and test runner by
introducing a new frontmatter "tag", `async`. This brings asynchronous
test configuration in-line with other configuration mechanisms and also
provides a more natural means of test filtering.

The modifications to test files was made programatically using the
`grep` and `sed` utilities:

    $ grep "\$DONE" test/ -r --files-with-match --null | \
        xargs -0 sed -i 's/^\(flags:\s*\)\[/\1[async, /g'
    $ grep "\$DONE" test/ -rl --null | \
        xargs -0 grep -E '^flags:' --files-without-match --null | \
        xargs -0 sed -i 's/^---\*\//flags: [async]\n---*\//'
2016-02-12 13:03:19 -05:00
Mike Pennisi 219bdc6f73 Promise: Add tests to disallow faulty optimization
Add tests that assert behavior when a Promise is resolved with another
Promise whose `then` method has been overridden. Because all objects
with a `then` method are treated equivalently, the presence of a
[[PromiseState]] internal slot should have no effect on program
behavior.

These tests guard against a faulty optimization originally implemented
in V8:

https://bugs.chromium.org/p/v8/issues/detail?id=3641
2016-02-10 13:38:03 -05:00
Gorkem Yakin 738a24b109 Merge pull request from jugglinmike/improve-promise-coverage-resolve (closes #463) 2016-01-19 16:33:23 -08:00
Mike Pennisi b1b4f04494 Add tests for Promise Resolve Functions
Remove files that tested both PerformPromiseThen and
PromiseResolveFunction in favor of new tests that test
PromiseResolveFunction more directly and completely.
2016-01-19 16:32:36 -08:00
Gorkem Yakin 4a862fba95 Merge pull request #465 from jugglinmike/improve-promise-coverage-all-race
Improve Promise coverage: PerformPromiseAll & PeformPromiseRace
2016-01-15 16:19:18 -08:00
Gorkem Yakin cd60a6d83a Merge pull request #464 from jugglinmike/improve-promise-coverage-cap
Improve Promise coverage: NewPromiseCapability
2016-01-13 16:49:47 -08:00
Mike Pennisi 7fab70bb21 Add tests for Promise Reject Functions 2016-01-07 13:24:42 -05:00
Mike Pennisi 615f42274d Extend coverage for NewPromiseCapability 2016-01-07 12:42:44 -05:00
Mike Pennisi 6e9d88a293 Extend coverage for PerformPromiseRace 2016-01-07 12:42:21 -05:00
Gorkem Yakin ca0e411870 Merge pull request #447 from anba/promise_coverage
Improve test coverage for various Promise methods
2015-12-10 08:29:38 -08:00
Rick Waldron 59dfae6311 Merge pull request #450 from cscott/promise-improvements
Remove unnecessary ES2015 syntax; add feature flags where appropriate.
2015-12-04 14:50:52 -05:00
C. Scott Ananian bae004d531 Remove unnecessary ES2015 syntax; add feature flags where appropriate.
This allows these tests to be more easily reused to test Promise
implementations in isolation.
2015-12-03 17:34:17 -05:00
André Bargull bd8c91e250 Updates for ES2016 Draft 2015-12-01
- RegExp.prototype[Symbol.split] calls ToUint32 (https://github.com/tc39/ecma262/issues/92)
- Species lookup removed from Promise.all and Promise.race (https://github.com/tc39/ecma262/issues/151)
- Generator functions are no longer constructors (https://github.com/tc39/ecma262/pull/171)

Fixes #444
2015-12-02 18:07:06 +01:00
André Bargull 5279bcb174 Improve test coverage for various Promise methods 2015-12-02 18:06:40 +01:00
Brian Terlson e427e67eb6 Merge pull request #358 from bocoup/promise
Extend test coverage for Promise built-in
2015-07-21 16:26:55 -07:00
Mike Pennisi 10e0d977ec Prefer explicit error checking where possible
The `negative` frontmatter tag expresses an expectation for the behavior
of the test file as a whole. The `assert.throws` helper function offers
more fine-grained control over expectations because it may be applied to
specific statements and expressions. This makes it preferable in cases
where it may be used (i.e. when the test body does not describe a syntax
error or early error).

Re-implement assertions for errors to use the `assert.throws` helper
function wherever possible.
2015-07-10 14:12:57 -04:00
Mike Pennisi 2bb1003ab1 Extend test coverage for Promise built-in 2015-07-08 14:08:24 -04:00
Mike Pennisi 4e2f350875 Formalize tests for built-in Promise methods
Uniformly and exhaustively test the generic aspects of the static- and
instance Promise methods, including:

- function `length` properties
- function `name` properties
- method property descriptors
2015-07-07 13:55:57 -04:00
Mike Pennisi 5e8b276bf5 fixup! Fix bug in test 2015-06-23 12:03:09 -04:00
Jordan Harband 00fb43009a Promise methods should not be enumerable, per https://people.mozilla.org/~jorendorff/es6-draft.html#table-4 2015-06-01 17:26:59 -07:00
Rick Waldron d9554f9fca Move test/built-ins/Promise/prototype/race/ to test/built-ins/Promise/race/. Closes gh-145 2015-02-17 13:33:34 -05:00