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

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: Added UseCounter for the new getStats 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..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>
« 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