OLD | NEW |
1 | 1 |
2 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | 2 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
3 <html> | 3 <html> |
4 <head> | 4 <head> |
5 <script src="../js/resources/js-test-pre.js"></script> | 5 <script src="../js/resources/js-test-pre.js"></script> |
6 </head> | 6 </head> |
7 <body> | 7 <body> |
8 <script> | 8 <script> |
9 description("Tests the RTCPeerConnection stats interface."); | 9 description("Tests the RTCPeerConnection stats interface."); |
10 | 10 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 testPassed("statsHandler2 was called"); | 49 testPassed("statsHandler2 was called"); |
50 // Status must be a global variable to be used in test statements. | 50 // Status must be a global variable to be used in test statements. |
51 status_g = status; | 51 status_g = status; |
52 result = status.result(); | 52 result = status.result(); |
53 shouldBeGreaterThanOrEqual('result.length', '2'); | 53 shouldBeGreaterThanOrEqual('result.length', '2'); |
54 // The "local" interface is deprecated. Keep test until interface deleted. | 54 // The "local" interface is deprecated. Keep test until interface deleted. |
55 local = result[0].local; | 55 local = result[0].local; |
56 timestamp = local.timestamp; | 56 timestamp = local.timestamp; |
57 // Windows XP sometimes gives time that appears to go backwards. | 57 // Windows XP sometimes gives time that appears to go backwards. |
58 // This hack will make the tests non-flaky if it never goes backwards | 58 // This hack will make the tests non-flaky if it never goes backwards |
59 // by more than 1 millisecond. | 59 // by more than 20 milliseconds. |
60 fudgeForXP = 1; | 60 // Up to 10 milliseconds has been observed on XP, 2 milliseconds on Win7. |
| 61 fudgeForXP = 20; |
61 timediff = timestamp - startTime + fudgeForXP; | 62 timediff = timestamp - startTime + fudgeForXP; |
62 shouldBeGreaterThanOrEqual('timediff', '0'); | 63 shouldBeGreaterThanOrEqual('timediff', '0'); |
63 shouldBeGreaterThanOrEqual('local.names().length', '1'); | 64 shouldBeGreaterThanOrEqual('local.names().length', '1'); |
64 shouldBeGreaterThanOrEqual('local.names().indexOf("type")', '0'); | 65 shouldBeGreaterThanOrEqual('local.names().indexOf("type")', '0'); |
65 shouldBe('local.stat("type")', '"audio"'); | 66 shouldBe('local.stat("type")', '"audio"'); |
66 // Newer interface. | 67 // Newer interface. |
67 res = result[0]; | 68 res = result[0]; |
68 timediff = timestamp - startTime + fudgeForXP; | 69 timediff = timestamp - startTime + fudgeForXP; |
69 shouldBeGreaterThanOrEqual('timediff', '0'); | 70 shouldBeGreaterThanOrEqual('timediff', '0'); |
70 shouldBeNonNull('res.id'); | 71 shouldBeNonNull('res.id'); |
(...skipping 10 matching lines...) Expand all Loading... |
81 var startTime = new Date().getTime(); | 82 var startTime = new Date().getTime(); |
82 shouldNotThrow('pc = new webkitRTCPeerConnection(null)'); | 83 shouldNotThrow('pc = new webkitRTCPeerConnection(null)'); |
83 shouldNotThrow('pc.getStats(statsHandler1)'); | 84 shouldNotThrow('pc.getStats(statsHandler1)'); |
84 | 85 |
85 window.jsTestIsAsync = true; | 86 window.jsTestIsAsync = true; |
86 window.successfullyParsed = true; | 87 window.successfullyParsed = true; |
87 </script> | 88 </script> |
88 <script src="../js/resources/js-test-post.js"></script> | 89 <script src="../js/resources/js-test-post.js"></script> |
89 </body> | 90 </body> |
90 </html> | 91 </html> |
OLD | NEW |