) => pc2.close());

    let eventCount = 0;
    const states = [
      'stable', 'have-local-offer', 'stable', 'have-remote-offer',
    ];
    pc.onsignalingstatechange = t.step_func(() =>
        assert_equals(pc.signalingState, states[++eventCount]));

    const assert_state = state => {
      assert_equals(state, pc.signalingState);
      assert_equals(state, states[eventCount]);
    };

    const offer = await generateAudioReceiveOnlyOffer(pc);
    assert_state('stable');
    await pc.setLocalDescriptio