Roll src/third_party/WebKit a452221:9ff6d11 (svn 202117:202119)
[chromium-blink-merge.git] / android_webview / tools / WebViewShell / test / blink-apis / webrtc / mediastream-callbacks.html
blob7db56fc73328e680a936aab0585e4d3819f2eea4
1 <!DOCTYPE html>
2 <html>
3 <script src="../../resources/js-test.js"></script>
4 <body>
5 <script type="text/javascript">
6 description("Test MediaStream API callbacks in WebView");
7 window.jsTestIsAsync = true;
9 function error(e) {
10 testFailed('getUserMedia error callback, reason: ' + e.name);
11 finishJSTest();
14 function gotStream(stream) {
15 testPassed('getUserMedia succeeded.');
16 track = stream.getVideoTracks()[0];
17 activeStream = stream;
18 shouldBeEqualToString('track.readyState', 'live');
19 shouldBeTrue('activeStream.active');
20 finishJSTest();
23 function getUserMedia(constraints, callback) {
24 try {
25 navigator.webkitGetUserMedia(constraints, callback, error);
26 } catch (e) {
27 testFailed('webkitGetUserMedia threw exception :' + e);
28 finishJSTest();
32 getUserMedia({audio:true, video:true}, gotStream);
33 </script>
34 </body>
35 </html>