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

Side by Side Diff: LayoutTests/fast/mediastream/RTCPeerConnection-statsSelector.html

Issue 23648005: Moving clock timeout flakiness guard in test to 20 ms (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 3 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="../js/resources/js-test-pre.js"></script> 4 <script src="../js/resources/js-test-pre.js"></script>
5 </head> 5 </head>
6 <body> 6 <body>
7 <script> 7 <script>
8 description("Tests the RTCPeerConnection stats selector argument."); 8 description("Tests the RTCPeerConnection stats selector argument.");
9 9
10 var pc = null; 10 var pc = null;
(...skipping 23 matching lines...) Expand all
34 shouldNotThrow('pc.getStats(statsHandler2, pc.getLocalStreams()[0].getVideoT racks()[0])'); 34 shouldNotThrow('pc.getStats(statsHandler2, pc.getLocalStreams()[0].getVideoT racks()[0])');
35 } 35 }
36 36
37 function statsHandler2(status) 37 function statsHandler2(status)
38 { 38 {
39 testPassed("statsHandler2 was called"); 39 testPassed("statsHandler2 was called");
40 result = status.result(); 40 result = status.result();
41 shouldBeGreaterThanOrEqual('result.length', '1'); 41 shouldBeGreaterThanOrEqual('result.length', '1');
42 local = result[0].local; 42 local = result[0].local;
43 timestamp = local.timestamp; 43 timestamp = local.timestamp;
44 shouldBeGreaterThanOrEqual('timestamp', 'startTime'); 44 // Windows XP sometimes gives time that appears to go backwards.
45 // This hack will make the tests non-flaky if it never goes backwards
46 // by more than 20 milliseconds.
47 // Up to 10 milliseconds has been observed on XP, 2 milliseconds on Win7.
48 fudgeForXP = 20;
49 timediff = timestamp - startTime + fudgeForXP;
50 shouldBeGreaterThanOrEqual('timediff', '0');
45 shouldBe('local.stat("type")', '"video"'); 51 shouldBe('local.stat("type")', '"video"');
46 finishJSTest(); 52 finishJSTest();
47 } 53 }
48 54
49 var startTime = new Date().getTime(); 55 var startTime = new Date().getTime();
50 shouldNotThrow('pc = new webkitRTCPeerConnection(null)'); 56 shouldNotThrow('pc = new webkitRTCPeerConnection(null)');
51 shouldNotThrow('getUserMedia({audio:true, video:true}, gotStream)'); 57 shouldNotThrow('getUserMedia({audio:true, video:true}, gotStream)');
52 58
53 window.jsTestIsAsync = true; 59 window.jsTestIsAsync = true;
54 window.successfullyParsed = true; 60 window.successfullyParsed = true;
55 </script> 61 </script>
56 <script src="../js/resources/js-test-post.js"></script> 62 <script src="../js/resources/js-test-post.js"></script>
57 </body> 63 </body>
58 </html> 64 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698