Bug 1526801 [wpt PR 15292] - [PeerConnection] Fire signalingstatechange event at the right time, a=testonly
authorGuido Urdaneta <guidou@chromium.org>
Wed, 06 Mar 2019 12:35:06 +0000
changeset 464658 325b153de47f8f7395434535bf434eb2dcff08da
parent 464657 063b443f99cd6346bfaf3ac5f93f0c7019a27550
child 464659 6efd7c8086b30f00184ada4207a5797c7ed26511
push id35717
push useraciure@mozilla.com
push dateSun, 17 Mar 2019 09:45:26 +0000
treeherdermozilla-central@e0861be8d6c0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1526801, 15292, 920200, 1458203, 634609
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1526801 [wpt PR 15292] - [PeerConnection] Fire signalingstatechange event at the right time, a=testonly Automatic update from web-platform-tests [PeerConnection] Fire signalingstatechange event at the right time Prior to this CL, the event was fired before the transceiver state was updated, in contradiction with the spec, which says it should be fired after the transceiver state is updated. Bug: 920200 Change-Id: I757cc0161a5da4888cd628619180e24a54dc732b Reviewed-on: https://chromium-review.googlesource.com/c/1458203 Commit-Queue: Guido Urdaneta <guidou@chromium.org> Reviewed-by: Henrik Boström <hbos@chromium.org> Cr-Commit-Position: refs/heads/master@{#634609} -- wpt-commits: 0f4203743c56377734f9682abb015d56d6a1a71e wpt-pr: 15292
testing/web-platform/tests/webrtc/RTCPeerConnection-onsignalingstatechanged.https.html
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/webrtc/RTCPeerConnection-onsignalingstatechanged.https.html
@@ -0,0 +1,30 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>RTCPeerConnection onsignalingstatechanged</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="RTCPeerConnection-helper.js"></script>
+<script>
+
+promise_test(async t => {
+  const [track] = (await navigator.mediaDevices.getUserMedia({video: true})).getTracks();
+  t.add_cleanup(() => track.stop());
+  const pc1 = new RTCPeerConnection();
+  t.add_cleanup(() => pc1.close());
+  const pc2 = new RTCPeerConnection();
+  t.add_cleanup(() => pc2.close());
+  pc1.addTrack(track, new MediaStream());
+  await pc1.setLocalDescription(await pc1.createOffer());
+  await pc2.setRemoteDescription(pc1.localDescription);
+  const signalingStateChangeResolver = new Resolver();
+  pc2.onsignalingstatechange = t.step_func(e => {
+    const transceiver = pc2.getTransceivers()[0];
+    assert_equals(pc2.signalingState, "stable");
+    assert_equals(transceiver.currentDirection, "recvonly");
+    signalingStateChangeResolver.resolve();
+  });
+  await pc2.setLocalDescription(await pc2.createAnswer());
+  await signalingStateChangeResolver;
+});
+
+</script>