 src="/webrtc-extensions/RTCRtpSynchronizationSource-helper.js"></script>
<script>
'use strict';

function listenForSenderCaptureTimeOffset(t, receiver) {
  return new Promise((resolve) => {
    function listen() {
      const ssrcs = receiver.getSynchronizationSources();
      assert_true(ssrcs != undefined);
      if (ssrcs.length > 0) {
        assert_equals(ssrcs.length, 1);
        if (ssrcs[0].captureTimestamp != undefined) {
          resolve(ssrcs[0].senderCaptureTimeOffset);
          return true;
