Brought relevant parts from webrtc testing stuff across