OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <style> | 3 <style> |
4 div#test { | 4 div#test { |
5 display: none; | 5 display: none; |
6 background-color: blue; | 6 background-color: blue; |
7 width: 100px; | 7 width: 100px; |
8 height: 100px; | 8 height: 100px; |
9 } | 9 } |
10 </style> | 10 </style> |
(...skipping 10 matching lines...) Expand all Loading... |
21 { | 21 { |
22 function runEventsSanityCheck(events) | 22 function runEventsSanityCheck(events) |
23 { | 23 { |
24 var phaseComplete = 0; | 24 var phaseComplete = 0; |
25 var knownEvents = {}; | 25 var knownEvents = {}; |
26 var processes = {}; | 26 var processes = {}; |
27 var threads = {}; | 27 var threads = {}; |
28 | 28 |
29 knownEvents["MessageLoop::PostTask"] = 0; | 29 knownEvents["MessageLoop::PostTask"] = 0; |
30 knownEvents["v8.callFunction"] = 0; | 30 knownEvents["v8.callFunction"] = 0; |
31 knownEvents["Document::recalcStyle"] = 0; | 31 knownEvents["Document::updateRenderTree"] = 0; |
32 knownEvents["FrameView::layout"] = 0; | 32 knownEvents["FrameView::layout"] = 0; |
33 | 33 |
34 for (var i = 0; i < events.length; ++i) { | 34 for (var i = 0; i < events.length; ++i) { |
35 var event = events[i]; | 35 var event = events[i]; |
36 if (event.ph === "X") | 36 if (event.ph === "X") |
37 ++phaseComplete; | 37 ++phaseComplete; |
38 if (event.name in knownEvents) | 38 if (event.name in knownEvents) |
39 ++knownEvents[event.name]; | 39 ++knownEvents[event.name]; |
40 processes[event.pid] = (processes[event.pid] || 0) + 1; | 40 processes[event.pid] = (processes[event.pid] || 0) + 1; |
41 threads[event.tid] = (threads[event.tid] || 0) + 1; | 41 threads[event.tid] = (threads[event.tid] || 0) + 1; |
42 } | 42 } |
43 InspectorTest.assertGreaterOrEqual(events.length, 100, "Too few trace ev
ents recorded"); | 43 InspectorTest.assertGreaterOrEqual(events.length, 100, "Too few trace ev
ents recorded"); |
44 InspectorTest.assertGreaterOrEqual(knownEvents["v8.callFunction"], 10, "
Too few v8.callFunction"); | 44 InspectorTest.assertGreaterOrEqual(knownEvents["v8.callFunction"], 10, "
Too few v8.callFunction"); |
45 InspectorTest.assertGreaterOrEqual(knownEvents["Document::recalcStyle"],
1, "Too few Document::recalcStyle"); | 45 InspectorTest.assertGreaterOrEqual(knownEvents["Document::updateRenderTr
ee"], 1, "Too few Document::recalcStyle"); |
46 InspectorTest.assertGreaterOrEqual(knownEvents["FrameView::layout"], 1,
"Too few FrameView::layout"); | 46 InspectorTest.assertGreaterOrEqual(knownEvents["FrameView::layout"], 1,
"Too few FrameView::layout"); |
47 InspectorTest.assertGreaterOrEqual(phaseComplete, 50, "Too few begin eve
nts"); | 47 InspectorTest.assertGreaterOrEqual(phaseComplete, 50, "Too few begin eve
nts"); |
48 InspectorTest.assertGreaterOrEqual(Object.keys(processes).length, 2, "To
o few processes"); | 48 InspectorTest.assertGreaterOrEqual(Object.keys(processes).length, 2, "To
o few processes"); |
49 InspectorTest.assertGreaterOrEqual(Object.keys(threads).length, 4, "Too
few threads"); | 49 InspectorTest.assertGreaterOrEqual(Object.keys(threads).length, 4, "Too
few threads"); |
50 InspectorTest.addResult("Event sanity test done"); | 50 InspectorTest.addResult("Event sanity test done"); |
51 } | 51 } |
52 | 52 |
53 function onTracingComplete() | 53 function onTracingComplete() |
54 { | 54 { |
55 InspectorTest.addResult("Tracing complete"); | 55 InspectorTest.addResult("Tracing complete"); |
(...skipping 12 matching lines...) Expand all Loading... |
68 } | 68 } |
69 } | 69 } |
70 | 70 |
71 </script> | 71 </script> |
72 </head> | 72 </head> |
73 <body onload="runTest()"> | 73 <body onload="runTest()"> |
74 <div id="test"> | 74 <div id="test"> |
75 </div> | 75 </div> |
76 </body> | 76 </body> |
77 </html> | 77 </html> |
OLD | NEW |