'Performs test setup by building a HTTP/2 connection object, a transport
to back it, a reactor to run in, and sending in some initial data as
needed.
@param initialData: The initial HTTP/2 data to be fed into the
connection after setup.
@type initialData: L{bytes}
@param requestFactory: The L{Request} factory to use with the
connection.'

def initiateH2Connection(self, initialData, requestFactory):

    reactor = task.Clock()
    conn = H2Connection(reactor)
    conn.timeOut = 100
    self.patch_TimeoutMixin_clock(conn, reactor)
    transport = StringTransport()
    conn.requestFactory = _makeRequestProxyFactory(requestFactory)
    conn.makeConnection(transport)
    for byte in iterbytes(initialData):
        conn.dataReceived(byte)
    return (reactor, conn, transport)
