From 990fbcf2f8a62b68cd646374b835824125336aac Mon Sep 17 00:00:00 2001 From: Adam Rice Date: Fri, 8 Sep 2017 14:59:33 +0900 Subject: [PATCH] TransformStream: add a test that start() is called exactly once --- .../to-upstream-wpts/transform-streams/general.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/reference-implementation/to-upstream-wpts/transform-streams/general.js b/reference-implementation/to-upstream-wpts/transform-streams/general.js index cee5e9705..fbfdf313a 100644 --- a/reference-implementation/to-upstream-wpts/transform-streams/general.js +++ b/reference-implementation/to-upstream-wpts/transform-streams/general.js @@ -411,4 +411,16 @@ promise_test(() => { return cancelPromise; }, 'close() should throw after readable.cancel()'); +promise_test(() => { + let calls = 0; + new TransformStream({ + start() { + ++calls; + } + }); + return flushAsyncEvents().then(() => { + assert_equals(calls, 1, 'start() should have been called exactly once'); + }); +}, 'start() should not be called twice'); + done();