Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / mediastream / RTCPeerConnection-statsSelector.html
blob4213eb625cac1d40e033b64559fe1a557337881d
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <script src="../../resources/js-test.js"></script>
5 </head>
6 <body>
7 <script>
8 description("Tests the RTCPeerConnection stats selector argument.");
10 var pc = null;
11 var result;
13 function getUserMedia(dictionary, callback) {
14 try {
15 navigator.webkitGetUserMedia(dictionary, callback, error);
16 } catch (e) {
17 testFailed('webkitGetUserMedia threw exception :' + e);
18 finishJSTest();
22 function error() {
23 testFailed('Stream generation failed.');
24 finishJSTest();
27 function gotStream(s) {
28 testPassed('Got a stream.');
29 stream = s;
31 pc.addStream(stream);
32 shouldNotThrow('pc.getStats(statsHandler2, pc.getLocalStreams()[0].getVideoTracks()[0])');
35 function statsHandler2(status)
37 testPassed("statsHandler2 was called");
38 result = status.result();
39 shouldBeGreaterThanOrEqual('result.length', '1');
40 // Windows XP sometimes gives time that appears to go backwards.
41 // This hack will make the tests non-flaky if it never goes backwards
42 // by more than 20 milliseconds.
43 // Up to 10 milliseconds has been observed on XP, 2 milliseconds on Win7.
44 fudgeForXP = 20;
45 res = result[0];
46 timediff = res.timestamp - startTime + fudgeForXP;
47 shouldBeGreaterThanOrEqual('timediff', '0');
48 shouldBe('res.stat("type")', '"video"');
49 finishJSTest();
52 var startTime = new Date().getTime();
53 shouldNotThrow('pc = new webkitRTCPeerConnection(null)');
54 shouldNotThrow('getUserMedia({audio:true, video:true}, gotStream)');
56 window.jsTestIsAsync = true;
57 window.successfullyParsed = true;
58 </script>
59 </body>
60 </html>