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

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: 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 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);
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
11
12 promise_test(function() {
13 return navigator.mediaDevices.getUserMedia({audio:true, video:true}).the n(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.
14 pc.addStream(mediaStream);
15 var selector = pc.getLocalStreams()[0].getVideoTracks()[0];
16 assert_not_equals(selector, null);
17 return pc.getStats(selector).then(
18 function(statsReport) {
19 assert_unreached('Expected promise to be rejected.');
20 },
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}).the n(function(mediaStream) {
30 pc.addStream(mediaStream);
31 return pc.getStats(null).then(
32 function(statsReport) {
33 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.
34 },
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}).the n(function(mediaStream) {
44 pc.addStream(mediaStream);
45 return pc.getStats().then(
46 function(statsReport) {
47 assert_unreached('Expected promise to be rejected.');
48 },
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