Chromium Code Reviews| 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..dae8206f639e4eb682ee1cec32e5fec993e5c70c |
| --- /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); |
|
hta - Chromium
2016/07/21 23:02:37
I don't think you should indent the Javascript due
hbos_chromium
2016/07/22 15:08:20
Other RTCPeerConnection testharness tests look thi
|
| + |
| + promise_test(function() { |
| + return navigator.mediaDevices.getUserMedia({audio:true, video:true}).then(function(mediaStream) { |
|
hta - Chromium
2016/07/21 23:02:37
Note that the examples in https://www.chromium.org
hbos_chromium
2016/07/22 15:08:20
Done.
|
| + pc.addStream(mediaStream); |
| + var selector = pc.getLocalStreams()[0].getVideoTracks()[0]; |
| + assert_not_equals(selector, null); |
| + return pc.getStats(selector).then( |
| + function(statsReport) { |
| + assert_unreached('Expected promise to 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('Expected promise to be rejected.'); |
|
hta - Chromium
2016/07/21 23:02:37
Use form "The promise should be rejected".
hbos_chromium
2016/07/22 15:08:20
Done.
|
| + }, |
| + 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('Expected promise to be rejected.'); |
| + }, |
| + function(reason) { |
| + // Expecting promise to be rejected until getStats is implemented. |
| + // crbug.com/627816 |
| + }); |
| + }); |
| + }, 'getStats()'); |
| + </script> |
| + </body> |
| +</html> |