Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WritableStream: Add smoke tests for abort() with non-Error arguments #9944

Merged

Conversation

Projects
None yet
4 participants
@ricea
Copy link
Contributor

ricea commented Mar 9, 2018

Verify that abort(), abort(undefined) and abort('string') all work as
expected, when called on a writer. The reason must be reflected in
rejections received from the object.

WritableStream: Add smoke tests for abort() with non-Error arguments
Verify that abort(), abort(undefined) and abort('string') all work as
expected, when called on a writer. The reason must be reflected in
rejections received from the object.
@w3c-bots

This comment has been minimized.

Copy link

w3c-bots commented Mar 9, 2018

Build PASSED

Started: 2018-03-09 14:24:24
Finished: 2018-03-09 14:38:55

Failing Jobs

  • MicrosoftEdge:16.16299

Unstable Results

Browser: "Microsoftedge 16.16299" (failures allowed)

View in: WPT PR Status | TravisCI

Test Subtest Results Messages
/streams/writable-streams/aborting.html   TIMEOUT: 5
OK: 5
  Aborting a WritableStream after it is closed is a no-op PASS: 5
  Aborting a WritableStream before it starts should cause the writer's unsettled ready promise to reject FAIL: 5
assert_throws: the ready promise should reject with error1 function "function () { throw e }" threw object "TypeError: UnderlyingSink abort() threw an exception." ("TypeError") expected object "error1: error1" ("error1")
  Aborting a WritableStream causes any outstanding write() promises to be rejected with the reason supplied FAIL: 5
assert_throws: writing should reject with error1 function "function () { throw e }" threw object "TypeError: UnderlyingSink abort() threw an exception." ("TypeError") expected object "error1: error1" ("error1")
  Aborting a WritableStream immediately prevents future writes FAIL: 5
assert_throws: write(1) must reject with error1 function "function () { throw e }" threw object "TypeError: UnderlyingSink abort() threw an exception." ("TypeError") expected object "error1: error1" ("error1")
  Aborting a WritableStream passes through the given reason PASS: 5
  Aborting a WritableStream prevents further writes after any that are in progress FAIL: 5
assert_throws: write(2) must reject with error1 function "function () { throw e }" threw object "TypeError: UnderlyingSink abort() threw an exception." ("TypeError") expected object "error1: error1" ("error1")
  Aborting a WritableStream puts it in an errored state with the error passed to abort() FAIL: 5
assert_throws: writing should reject with error1 function "function () { throw e }" threw object "TypeError: UnderlyingSink abort() threw an exception." ("TypeError") expected object "error1: error1" ("error1")
  Aborting a WritableStream should cause the writer's fulfilled ready promise to reset to a rejected one FAIL: 5
assert_throws: the ready promise should reject with error1 function "function () { throw e }" threw object "TypeError: UnderlyingSink abort() threw an exception." ("TypeError") expected object "error1: error1" ("error1")
  abort() on a released writer rejects PASS: 5
  abort() should be rejected with the rejection returned from close() PASS: 5
  abort() should succeed despite rejection from write PASS: 5
  abort with an undefined argument should set the stored error to undefined FAIL: 5
assert_equals: e should be undefined expected (undefined) undefined but got (object) object "TypeError: UnderlyingSink abort() threw an exception."
  abort with a string argument should set the stored error to that argument FAIL: 5
assert_equals: e should be 'string argument' expected (string) "string argument" but got (object) object "TypeError: UnderlyingSink abort() threw an exception."
  abort with no arguments should set the stored error to undefined FAIL: 5
assert_equals: e should be undefined expected (undefined) undefined but got (object) object "TypeError: UnderlyingSink abort() threw an exception."
  an abort() that happens during a write() should trigger the underlying abort() even with a close() queued FAIL: 5
assert_throws: promise returned by close() should be rejected function "function () { throw e }" threw object "TypeError: UnderlyingSink abort() threw an exception." ("TypeError") expected object "error1: error1" ("error1")
  a rejecting sink.write() should not prevent sink.abort() from being called FAIL: 5
assert_throws: closed should reject with error2 function "function () { throw e }" threw object "TypeError: UnderlyingSink abort() threw an exception." ("TypeError") expected object "error2: error2" ("error2")
  calling abort() on an errored stream should fulfill with undefined FAIL: 5
promise_test: Unhandled rejection with value: object "error1: error1"
  .closed should not resolve before fulfilled write() FAIL: 5
assert_throws: .closed should reject function "function () { throw e }" threw object "TypeError: UnderlyingSink abort() threw an exception." ("TypeError") expected object "error1: error1" ("error1")
  .closed should not resolve before rejected write(); write() error should not overwrite abort() error FAIL: 5
assert_throws: .closed should reject function "function () { throw e }" threw object "TypeError: UnderlyingSink abort() threw an exception." ("TypeError") expected object "error2: error2" ("error2")
  close() should reject with abort reason why abort() is first error FAIL: 5
assert_throws: writer.close() should reject with error from underlying write() function "function () { throw e }" threw object "TypeError: UnderlyingSink abort() threw an exception." ("TypeError") expected object "error2: error2" ("error2")
  Closing a WritableStream and aborting it while it closes causes the stream to ignore the abort attempt PASS: 5
  Closing but then immediately aborting a WritableStream causes the stream to error FAIL: 5
assert_throws: closed should reject with error1 function "function () { throw e }" threw object "TypeError: UnderlyingSink abort() threw an exception." ("TypeError") expected object "error1: error1" ("error1")
  controller.error(), writer.abort() while there is an in-flight close, and then finish the close PASS: 5
  controller.error(), writer.abort() while there is an in-flight write, and then finish the write PASS: 5
  Fulfillment value of ws.abort() call must be undefined even if the underlying sink returns a non-undefined value PASS: 5
  if a writer is created for a stream with a pending abort, its ready should be rejected with the abort error FAIL: 5
assert_throws: ready of the second writer should be rejected with error1 function "function () { throw e }" threw object "TypeError: UnderlyingSink abort() threw an exception." ("TypeError") expected object "error1: error1" ("error1")
  if start attempts to error the controller after abort() has been called, then it should lose PASS: 5
  if underlying close() has started and then rejects, the abort() and close() promises should reject with the underlying close rejection reason PASS: 5
  promises returned from other writer methods should be rejected when writer abort() happens during sink start() FAIL: 5
assert_throws: second write() should reject function "function () { throw e }" threw object "TypeError: UnderlyingSink abort() threw an exception." ("TypeError") expected object "error1: error1" ("error1")
  releaseLock() during delayed async abort() should reject the writer.closed promise PASS: 5
  releaseLock() while aborting should reject the original closed promise FAIL: 5
promise_test: Unhandled rejection with value: object "TypeError: Failed to write."
  returning a thenable from abort() should work PASS: 5
  sink abort() should not be called if stream was erroring due to bad strategy before abort() was called FAIL: 5
assert_unreached: Should have rejected: abort() should reject Reached unreachable code
  sink abort() should not be called if stream was erroring due to controller.error() before abort() was called PASS: 5
  sink abort() should not be called until sink start() is done PASS: 5
  stream abort() promise should still resolve if sink start() rejects PASS: 5
  underlying abort() should not be called if underlying close() has started PASS: 5
  underlying abort() should not be called until underlying write() completes PASS: 5
  when calling abort() twice on the same stream, both should give the same promise that fulfills with undefined FAIL: 5
assert_equals: the promises must be the same expected object "[object Promise]" but got object "[object Promise]"
  when calling abort() twice on the same stream, but sequentially so so there's no pending abort the second time, both should fulfill with undefined FAIL: 5
promise_test: Unhandled rejection with value: object "TypeError: UnderlyingSink abort() threw an exception."
  when start errors after stream abort(), underlying sink abort() should be called anyway PASS: 5
  WritableStream if sink's abort throws, for an abort performed during a write, the promise returned by ws.abort() rejects PASS: 5
  WritableStream if sink's abort throws, the promise returned by multiple writer.abort()s is the same and rejects FAIL: 5
assert_equals: the promises must be the same expected object "[object Promise]" but got object "[object Promise]"
  WritableStream if sink's abort throws, the promise returned by writer.abort() rejects PASS: 5
  WritableStream if sink's abort throws, the promise returned by ws.abort() rejects PASS: 5
  WritableStream should NOT call underlying sink's close if no abort is supplied (historical) FAIL: 5
assert_throws: closed should reject with error1 function "function () { throw e }" threw object "TypeError: UnderlyingSink abort() threw an exception." ("TypeError") expected object "error1: error1" ("error1")
  writer.abort(), controller.error() while there is an in-flight close, and then finish the close FAIL: 5
assert_throws: writer.ready must reject with the error from abort function "function () { throw e }" threw object "TypeError: UnderlyingSink abort() threw an exception." ("TypeError") expected object "error1: error1" ("error1")
  writer.abort(), controller.error() while there is an in-flight write, and then finish the write FAIL: 5
assert_throws: writePromise2 must reject with the error from abort function "function () { throw e }" threw object "TypeError: UnderlyingSink abort() threw an exception." ("TypeError") expected object "error1: error1" ("error1")
  writer abort() during sink start() should replace the writer.ready promise synchronously FAIL: 5
assert_throws: writerReady2 should reject function "function () { throw e }" threw object "TypeError: UnderlyingSink abort() threw an exception." ("TypeError") expected object "error1: error1" ("error1")
  writer.abort() while there is an in-flight write, and then finish the write with rejection FAIL: 5
assert_throws: writePromise2 must reject with the error from abort function "function () { throw e }" threw object "TypeError: UnderlyingSink abort() threw an exception." ("TypeError") expected object "error1: error1" ("error1")
  writer close() promise should resolve before abort() promise PASS: 5
  writer.ready should reject on controller error without waiting for underlying write PASS: 5
  writes should be satisfied in order after rejected write when aborting FAIL: 5
assert_throws: first queued write should be rejected function "function () { throw e }" threw object "TypeError: UnderlyingSink abort() threw an exception." ("TypeError") expected object "error2: error2" ("error2")
  writes should be satisfied in order when aborting FAIL: 5
assert_throws: first queued write should be rejected function "function () { throw e }" threw object "TypeError: UnderlyingSink abort() threw an exception." ("TypeError") expected object "error1: error1" ("error1")

@domenic domenic merged commit dc2b101 into web-platform-tests:master Mar 14, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.