Commit e45eb066 authored by Henrik Boström's avatar Henrik Boström Committed by Commit Bot

Fix/improve external/wpt/webrtc/RTCPeerConnection-addTrack.https.html.

Updated all tests to use promise_tests(), async/await and added cleanup
logic for pc.close() in tests that did not already have that.

Replaced broken test:
  'addTrack with existing sender with null track, same kind, and
   sendrecv direction should create new sender'

With:
  'addTrack with existing sender that has not been used to send should
   reuse the sender',
  'addTrack with existing sender that has been used to send should
   create new sender'

Per-spec[1], if a sender has not been used to send (currentDirection
never having had the value 'sendrecv' or 'sendonly') it may be reused,
so the original test was incorrect.

The new tests make sure that in the original scenario the sender IS
reused, and in the case where the sender has been used a new sender is
created instead of reusing, even if the original sender is no longer
sending.

In Unified Plan[2], all tests PASS.

[1] Step 7 of
    https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnection-addtrack
[2] Work-in-Progress CL
    https://chromium-review.googlesource.com/c/chromium/src/+/1025771

Bug: 777617
Change-Id: I2b07bc03d84add30999e0e017bf008fbc9e9f89a
Reviewed-on: https://chromium-review.googlesource.com/1100828
Commit-Queue: Henrik Boström <hbos@chromium.org>
Reviewed-by: default avatarGuido Urdaneta <guidou@chromium.org>
Cr-Commit-Position: refs/heads/master@{#567592}
parent b130efd4
This is a testharness.js-based test. This is a testharness.js-based test.
PASS addTrack when pc is closed should throw InvalidStateError PASS addTrack when pc is closed should throw InvalidStateError
FAIL addTrack with single track argument and no mediaStream should succeed promise_test: Unhandled rejection with value: object "TypeError: pc.getTransceivers is not a function" FAIL addTrack with single track argument and no stream should succeed promise_test: Unhandled rejection with value: object "TypeError: pc.getTransceivers is not a function"
PASS addTrack with single track argument and single mediaStream should succeed PASS addTrack with single track argument and single stream should succeed
FAIL addTrack with single track argument and multiple mediaStreams should succeed promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'addTrack' on 'RTCPeerConnection': Adding a track to multiple streams is not supported." FAIL addTrack with single track argument and multiple streams should succeed promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'addTrack' on 'RTCPeerConnection': Adding a track to multiple streams is not supported."
PASS Adding the same track multiple times should throw InvalidAccessError PASS Adding the same track multiple times should throw InvalidAccessError
FAIL addTrack with existing sender with null track, same kind, and recvonly direction should reuse sender pc.addTransceiver is not a function FAIL addTrack with existing sender with null track, same kind, and recvonly direction should reuse sender promise_test: Unhandled rejection with value: object "TypeError: pc.addTransceiver is not a function"
FAIL addTrack with existing sender with null track, same kind, and sendrecv direction should create new sender pc.addTransceiver is not a function FAIL addTrack with existing sender that has not been used to send should reuse the sender promise_test: Unhandled rejection with value: object "TypeError: pc.addTransceiver is not a function"
FAIL addTrack with existing sender with null track, different kind, and recvonly direction should create new sender pc.addTransceiver is not a function FAIL addTrack with existing sender that has been used to send should create new sender assert_idl_attribute: Expect pc to have addTransceiver() method property "addTransceiver" not found in prototype chain
FAIL addTrack with existing sender with null track, different kind, and recvonly direction should create new sender promise_test: Unhandled rejection with value: object "TypeError: pc.addTransceiver is not a function"
Harness: the test ran to completion. Harness: the test ran to completion.
This is a testharness.js-based test. This is a testharness.js-based test.
PASS addTrack when pc is closed should throw InvalidStateError PASS addTrack when pc is closed should throw InvalidStateError
FAIL addTrack with single track argument and no mediaStream should succeed promise_test: Unhandled rejection with value: object "TypeError: pc.getTransceivers is not a function" FAIL addTrack with single track argument and no stream should succeed promise_test: Unhandled rejection with value: object "TypeError: pc.getTransceivers is not a function"
PASS addTrack with single track argument and single mediaStream should succeed PASS addTrack with single track argument and single stream should succeed
PASS addTrack with single track argument and multiple mediaStreams should succeed PASS addTrack with single track argument and multiple streams should succeed
PASS Adding the same track multiple times should throw InvalidAccessError PASS Adding the same track multiple times should throw InvalidAccessError
FAIL addTrack with existing sender with null track, same kind, and recvonly direction should reuse sender pc.addTransceiver is not a function FAIL addTrack with existing sender with null track, same kind, and recvonly direction should reuse sender promise_test: Unhandled rejection with value: object "TypeError: pc.addTransceiver is not a function"
FAIL addTrack with existing sender with null track, same kind, and sendrecv direction should create new sender pc.addTransceiver is not a function FAIL addTrack with existing sender that has not been used to send should reuse the sender promise_test: Unhandled rejection with value: object "TypeError: pc.addTransceiver is not a function"
FAIL addTrack with existing sender with null track, different kind, and recvonly direction should create new sender pc.addTransceiver is not a function FAIL addTrack with existing sender that has been used to send should create new sender assert_idl_attribute: Expect pc to have addTransceiver() method property "addTransceiver" not found in prototype chain
FAIL addTrack with existing sender with null track, different kind, and recvonly direction should create new sender promise_test: Unhandled rejection with value: object "TypeError: pc.addTransceiver is not a function"
Harness: the test ran to completion. Harness: the test ran to completion.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment