1. 24 Jun, 2020 1 commit
  2. 01 Aug, 2018 1 commit
    • Andreas Haas's avatar
      [mjsunit] Move the implementation of testAsync into a separate file · 8c3c1b6c
      Andreas Haas authored
      The original implementation of 'testAsync' in mjsunit.js required to
      put the call to '%AbortJS' into an 'eval' statement. The reason is that
      this call requires the flag --allow-natives-syntax to be set, but the
      flag is not set in all mjsunit tests. With the use of 'eval'
      compilation errors can be avoided.
      
      The problem with this approach was that the fuzzer started to produce
      test cases which include the line 'eval("%AbortJS(message)");', and
      this line crashes intentionally. Different to the line
      '%Abort(message)', however, the 'eval' statement cannot be filtered
      so easily in the fuzzer. Therefore I pulled the implementation of
      'testAsync' into a separate file to avoid the 'eval'.
      
      Additional changes: I use '===' now instead of 'deepEquals' in
      AsyncAssertion.equals because 'deepEquals' is not available outside
      mjsunit.js. Using '===' seems more appropriate anyways because for
      all tests but one it is sufficient, and it is more precise than
      deepEquals.
      
      R=gsathya@chromium.org
      
      Bug: chromium:774841
      Change-Id: I47270aa63ff5a1d6aa76a771f9276eaaf579c5ac
      Reviewed-on: https://chromium-review.googlesource.com/1156598Reviewed-by: 's avatarSathya Gunasekaran <gsathya@chromium.org>
      Commit-Queue: Andreas Haas <ahaas@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#54833}
      8c3c1b6c
  3. 04 Jun, 2018 1 commit
  4. 14 Dec, 2017 1 commit
  5. 07 Sep, 2017 1 commit
  6. 26 Jul, 2017 1 commit
    • Sathya Gunasekaran's avatar
      [tests] Async test framework · 61ed6a00
      Sathya Gunasekaran authored
      - No need for multiple assertAsyncRan() calls, just do t.plan(count)
      
      - Previously, if you forget to call assertAsyncRan(), the test will still
        pass, which is no longer true.
      
      - No longer hold global state (with
        asyncAssertsExpected). Previously if one assert wasn't hit then
        there's no way to find out which test failed. You'd have to
        comment each test and try again.
      
      - Each test runs independently in the microtask queue.
      
      - Better failure reporting by printing the entire function.
      
      Example error :
      === mjsunit/harmony/promise-prototype-finally ===
      abort: Expected asserts: 2, Actual asserts: 1
      in test: reject/finally/then
      assert => {
        assert.plan(2);
        Promise.reject(3).finally().then(
          assert.unreachable,
          x => {
            assert.equals(3, x);
          });
      }
      
      
      Change-Id: Ic3f6272e1e87b8b0121b8c8c7cce19cf90d1f1be
      Reviewed-on: https://chromium-review.googlesource.com/455555
      Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org>
      Reviewed-by: 's avatarAdam Klein <adamk@chromium.org>
      Reviewed-by: 's avatarDaniel Ehrenberg <littledan@chromium.org>
      Reviewed-by: 's avatarCaitlin Potter <caitp@igalia.com>
      Cr-Commit-Position: refs/heads/master@{#46910}
      61ed6a00
  7. 17 Feb, 2017 1 commit