OLD | NEW |
| (Empty) |
1 <html> | |
2 <head> | |
3 <script src="../../http/tests/inspector/inspector-test.js"></script> | |
4 <script src="../../http/tests/inspector/timeline-test.js"></script> | |
5 <script> | |
6 | |
7 function performActions() | |
8 { | |
9 console.timeStamp("time is an illusion"); | |
10 } | |
11 | |
12 function test() | |
13 { | |
14 var beforeStart = Date.now(); | |
15 InspectorTest.startTimeline(); | |
16 InspectorTest.waitForRecordType("TimeStamp", onTimeStamp); | |
17 InspectorTest.evaluateInPage("performActions()"); | |
18 | |
19 function onTimeStamp(record) | |
20 { | |
21 var now = Date.now(); | |
22 var eventTime = record.startTime; | |
23 InspectorTest.assertGreaterOrEqual(eventTime, beforeStart, "event time s
hould be after timeline start time"); | |
24 InspectorTest.assertGreaterOrEqual(now, Math.floor(eventTime), "event ti
me should be before now"); | |
25 InspectorTest.addResult("done"); | |
26 InspectorTest.stopTimeline(InspectorTest.completeTest.bind(InspectorTest
)); | |
27 } | |
28 } | |
29 | |
30 </script> | |
31 </head> | |
32 | |
33 <body onload="runTest()"> | |
34 <p> | |
35 Tests sanity of timeline timestamps. | |
36 </p> | |
37 | |
38 </body> | |
39 </html> | |
OLD | NEW |