Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(536)

Unified Diff: third_party/WebKit/LayoutTests/fast/peerconnection/RTCPeerConnection-getStats-promise.html

Issue 2156063002: Preparation for new Promise-based RTCPeerConnection.getStats. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase with master Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/frame/UseCounter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/frame/UseCounter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698