| Index: third_party/WebKit/LayoutTests/fast/peerconnection/RTCPeerConnection-getStats-promise.html
|
| diff --git a/third_party/WebKit/LayoutTests/fast/peerconnection/RTCPeerConnection-getStats-promise.html b/third_party/WebKit/LayoutTests/fast/peerconnection/RTCPeerConnection-getStats-promise.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..731a63a7c80fb003a87c798aa577a51284cc22d3
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/fast/peerconnection/RTCPeerConnection-getStats-promise.html
|
| @@ -0,0 +1,57 @@
|
| +<!DOCTYPE html>
|
| +<html>
|
| +<head>
|
| +<title>RTCPeerConnection.getStats</title>
|
| +<script src="../../resources/testharness.js"></script>
|
| +<script src="../../resources/testharnessreport.js"></script>
|
| +</head>
|
| +<body>
|
| +<script>
|
| +var pc = new webkitRTCPeerConnection(null);
|
| +
|
| +promise_test(function() {
|
| + return navigator.mediaDevices.getUserMedia({audio:true, video:true})
|
| + .then(function(mediaStream) {
|
| + pc.addStream(mediaStream);
|
| + var selector = pc.getLocalStreams()[0].getVideoTracks()[0];
|
| + assert_not_equals(selector, null);
|
| + return pc.getStats(selector)
|
| + .then(function(statsReport) {
|
| + assert_unreached('The promise should be rejected.');
|
| + }, function(reason) {
|
| + // Expecting promise to be rejected until getStats is implemented.
|
| + // crbug.com/627816
|
| + });
|
| + });
|
| +}, 'getStats(MediaStreamTrack selector)');
|
| +
|
| +promise_test(function() {
|
| + return navigator.mediaDevices.getUserMedia({audio:true, video:true})
|
| + .then(function(mediaStream) {
|
| + pc.addStream(mediaStream);
|
| + return pc.getStats(null)
|
| + .then(function(statsReport) {
|
| + assert_unreached('The promise should be rejected.');
|
| + }, function(reason) {
|
| + // Expecting promise to be rejected until getStats is implemented.
|
| + // crbug.com/627816
|
| + });
|
| + });
|
| +}, 'getStats(null)');
|
| +
|
| +promise_test(function() {
|
| + return navigator.mediaDevices.getUserMedia({audio:true, video:true})
|
| + .then(function(mediaStream) {
|
| + pc.addStream(mediaStream);
|
| + return pc.getStats()
|
| + .then(function(statsReport) {
|
| + assert_unreached('The promise should be rejected.');
|
| + }, function(reason) {
|
| + // Expecting promise to be rejected until getStats is implemented.
|
| + // crbug.com/627816
|
| + });
|
| + });
|
| +}, 'getStats()');
|
| +</script>
|
| +</body>
|
| +</html>
|
|
|