@Test
public void outboundStreamShouldWriteResetFrameOnClose_headersSent() {

    childChannelInitializer.handler = new ChannelInboundHandlerAdapter() {
        @Override
        public void channelActive(ChannelHandlerContext ctx) throws Exception {
            ctx.writeAndFlush(new DefaultHttp2HeadersFrame(new DefaultHttp2Headers()));
            ctx.fireChannelActive();
        }
    };
    Channel childChannel = newOutboundStream();
    assertTrue(childChannel.isActive());
    Http2FrameStream stream2 = readOutboundHeadersAndAssignId();
    childChannel.close();
    parentChannel.runPendingTasks();
    Http2ResetFrame reset = parentChannel.readOutbound();
    assertEquals(stream2, reset.stream());
    assertEquals(Http2Error.CANCEL.code(), reset.errorCode());
}