setRemoteDescription({ type: 'answer', sdp: 'invalid' });
      t.unreached_func("Should have rejected.");
    } catch (e) {
      assert_throws_dom('InvalidStateError', () => { throw e });
    }
  }, 'setRemoteDescription() with invalid SDP and stable state should reject with InvalidStateError');

  /* Dedicated signalingstate events test. */

  promise_test(async t => {
    const pc = new RTCPeerConnection();
    const pc2 = new RTCPeerConnection();
    t.add_cleanup(() => pc.close());
    t.add_cleanup((