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

Side by Side 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, 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/frame/UseCounter.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <title>RTCPeerConnection.getStats</title>
5 <script src="../../resources/testharness.js"></script>
6 <script src="../../resources/testharnessreport.js"></script>
7 </head>
8 <body>
9 <script>
10 var pc = new webkitRTCPeerConnection(null);
11
12 promise_test(function() {
13 return navigator.mediaDevices.getUserMedia({audio:true, video:true})
14 .then(function(mediaStream) {
15 pc.addStream(mediaStream);
16 var selector = pc.getLocalStreams()[0].getVideoTracks()[0];
17 assert_not_equals(selector, null);
18 return pc.getStats(selector)
19 .then(function(statsReport) {
20 assert_unreached('The promise should be rejected.');
21 }, function(reason) {
22 // Expecting promise to be rejected until getStats is implemented.
23 // crbug.com/627816
24 });
25 });
26 }, 'getStats(MediaStreamTrack selector)');
27
28 promise_test(function() {
29 return navigator.mediaDevices.getUserMedia({audio:true, video:true})
30 .then(function(mediaStream) {
31 pc.addStream(mediaStream);
32 return pc.getStats(null)
33 .then(function(statsReport) {
34 assert_unreached('The promise should be rejected.');
35 }, function(reason) {
36 // Expecting promise to be rejected until getStats is implemented.
37 // crbug.com/627816
38 });
39 });
40 }, 'getStats(null)');
41
42 promise_test(function() {
43 return navigator.mediaDevices.getUserMedia({audio:true, video:true})
44 .then(function(mediaStream) {
45 pc.addStream(mediaStream);
46 return pc.getStats()
47 .then(function(statsReport) {
48 assert_unreached('The promise should be rejected.');
49 }, function(reason) {
50 // Expecting promise to be rejected until getStats is implemented.
51 // crbug.com/627816
52 });
53 });
54 }, 'getStats()');
55 </script>
56 </body>
57 </html>
OLDNEW
« 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