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

Side by Side Diff: LayoutTests/fast/mediastream/getusermedia-promise.html

Issue 1202553002: Implement navigator.mediaDevices.getUserMedia() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Review comments (cleanup) Created 5 years, 6 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
OLDNEW
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html> 2 <html>
3 <head> 3 <head>
4 <script src="../../resources/js-test.js"></script> 4 <script src="../../resources/testharness.js"></script>
5 <script src="../../resources/testharnessreport.js"></script>
5 </head> 6 </head>
6 <body> 7 <body>
7 <p id="description"></p> 8 <p id="description"></p>
8 <div id="console"></div> 9 <div id="console"></div>
9 <script> 10 <script>
10 description("Tests webkitGetUserMedia.");
11 11
12 var stream; 12 promise_test(function() {
13 var errorArg; 13 assert_idl_attribute(navigator, 'mediaDevices');
14 assert_idl_attribute(navigator.mediaDevices, 'getUserMedia');
15
16 return navigator.mediaDevices.getUserMedia({audio: true}).then(function(s) {
17 assert_equals(1, s.getTracks().length);
Peter Beverloo 2015/06/23 12:44:16 nit: when using testharness.js, the expected resul
hta - Chromium 2015/06/26 09:28:59 Test harnesses seem to flip randomly between the t
18 });
19 }, 'getUserMedia()');
20
21 </script>
22 <!--
Peter Beverloo 2015/06/23 12:44:16 Surely you don't mean to comment the rest of this
hta - Chromium 2015/06/26 09:28:59 No, I meant to convert the rest of the tests to te
14 23
15 function error() { 24 function error() {
16 testFailed('Error callback called.'); 25 testFailed('Error callback called.');
17 finishJSTest(); 26 finishJSTest();
18 } 27 }
19 28
20 function gotStreamInError(s) { 29 function gotStreamInError(s) {
21 testFailed('Stream generated.'); 30 testFailed('Stream generated.');
22 finishJSTest(); 31 finishJSTest();
23 } 32 }
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 83
75 shouldNotThrow("navigator.webkitGetUserMedia({video:true}, gotStream2, error );") 84 shouldNotThrow("navigator.webkitGetUserMedia({video:true}, gotStream2, error );")
76 } 85 }
77 86
78 shouldThrow("navigator.webkitGetUserMedia({audio:false, video:false}, error, err or);") 87 shouldThrow("navigator.webkitGetUserMedia({audio:false, video:false}, error, err or);")
79 shouldNotThrow("navigator.webkitGetUserMedia({audio:true}, gotStream1, error);") ; 88 shouldNotThrow("navigator.webkitGetUserMedia({audio:true}, gotStream1, error);") ;
80 89
81 window.jsTestIsAsync = true; 90 window.jsTestIsAsync = true;
82 window.successfullyParsed = true; 91 window.successfullyParsed = true;
83 </script> 92 </script>
93
94 -->
95
84 </body> 96 </body>
85 </html> 97 </html>
OLDNEW
« no previous file with comments | « no previous file | Source/modules/mediastream/MediaDevices.h » ('j') | Source/modules/mediastream/MediaDevices.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698