'When a L{H2Connection} times out with active streams, the error code
returned is L{h2.errors.ErrorCodes.PROTOCOL_ERROR}.'

def test_timeoutWithProtocolErrorIfStreamsOpen(self):

    frameFactory = FrameFactory()
    frames = buildRequestFrames(self.getRequestHeaders, [], frameFactory)
    initialData = frameFactory.clientConnectionPreface()
    initialData += ''.join((f.serialize() for f in frames))
    (reactor, conn, transport) = self.initiateH2Connection(initialData, requestFactory=DummyProducerHandler)
    reactor.advance(101)
    self.assertTimedOut(transport.value(), frameCount=2, errorCode=h2.errors.ErrorCodes.PROTOCOL_ERROR, lastStreamID=1)
    self.assertTrue(transport.disconnecting)
