| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <style> | 3 <style> |
| 4 div { | 4 div { |
| 5 display: inline-block; | 5 display: inline-block; |
| 6 border-style: solid; | 6 border-style: solid; |
| 7 } | 7 } |
| 8 | 8 |
| 9 div.img-container { | 9 div.img-container { |
| 10 position: relative; | 10 position: relative; |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 } | 75 } |
| 76 } | 76 } |
| 77 | 77 |
| 78 function test() | 78 function test() |
| 79 { | 79 { |
| 80 InspectorTest.invokeWithTracing("showImages", InspectorTest.safeWrap(onTraci
ngComplete)); | 80 InspectorTest.invokeWithTracing("showImages", InspectorTest.safeWrap(onTraci
ngComplete)); |
| 81 function onTracingComplete() | 81 function onTracingComplete() |
| 82 { | 82 { |
| 83 function isDecodeImageEvent(event) | 83 function isDecodeImageEvent(event) |
| 84 { | 84 { |
| 85 return event.name === WebInspector.TimelineModel.RecordType.DecodeIm
age; | 85 return event.name === TimelineModel.TimelineModel.RecordType.DecodeI
mage; |
| 86 } | 86 } |
| 87 function compareImageURLs(a, b) | 87 function compareImageURLs(a, b) |
| 88 { | 88 { |
| 89 var urlA = WebInspector.TimelineData.forEvent(a).url; | 89 var urlA = TimelineModel.TimelineData.forEvent(a).url; |
| 90 var urlB = WebInspector.TimelineData.forEvent(b).url; | 90 var urlB = TimelineModel.TimelineData.forEvent(b).url; |
| 91 urlA = InspectorTest.formatters.formatAsURL(urlA || "<missing>"); | 91 urlA = InspectorTest.formatters.formatAsURL(urlA || "<missing>"); |
| 92 urlB = InspectorTest.formatters.formatAsURL(urlB || "<missing>"); | 92 urlB = InspectorTest.formatters.formatAsURL(urlB || "<missing>"); |
| 93 return urlA.localeCompare(urlB); | 93 return urlA.localeCompare(urlB); |
| 94 } | 94 } |
| 95 var events = InspectorTest.timelineModel().inspectedTargetEvents(); | 95 var events = InspectorTest.timelineModel().inspectedTargetEvents(); |
| 96 var sortedDecodeEvents = events.filter(isDecodeImageEvent).sort(compareI
mageURLs); | 96 var sortedDecodeEvents = events.filter(isDecodeImageEvent).sort(compareI
mageURLs); |
| 97 for (var i = 0; i < sortedDecodeEvents.length; ++i) { | 97 for (var i = 0; i < sortedDecodeEvents.length; ++i) { |
| 98 var event = sortedDecodeEvents[i]; | 98 var event = sortedDecodeEvents[i]; |
| 99 var timlelineData = WebInspector.TimelineData.forEvent(event); | 99 var timlelineData = TimelineModel.TimelineData.forEvent(event); |
| 100 var url = timlelineData.url; | 100 var url = timlelineData.url; |
| 101 // Skip duplicate events, as long as they have the imageURL | 101 // Skip duplicate events, as long as they have the imageURL |
| 102 if (i && url && url === WebInspector.TimelineData.forEvent(sortedDec
odeEvents[i - 1]).url) | 102 if (i && url && url === TimelineModel.TimelineData.forEvent(sortedDe
codeEvents[i - 1]).url) |
| 103 continue; | 103 continue; |
| 104 InspectorTest.addResult("event: " + event.name); | 104 InspectorTest.addResult("event: " + event.name); |
| 105 InspectorTest.addResult("imageURL: " + InspectorTest.formatters.form
atAsURL(url)); | 105 InspectorTest.addResult("imageURL: " + InspectorTest.formatters.form
atAsURL(url)); |
| 106 InspectorTest.addResult("backendNodeId: " + (timlelineData.backendNo
deId > 0 ? "present" : "absent")); | 106 InspectorTest.addResult("backendNodeId: " + (timlelineData.backendNo
deId > 0 ? "present" : "absent")); |
| 107 } | 107 } |
| 108 InspectorTest.completeTest(); | 108 InspectorTest.completeTest(); |
| 109 } | 109 } |
| 110 } | 110 } |
| 111 | 111 |
| 112 </script> | 112 </script> |
| 113 </head> | 113 </head> |
| 114 | 114 |
| 115 <body onload="runTest()"> | 115 <body onload="runTest()"> |
| 116 <p> | 116 <p> |
| 117 Tests the instrumentation of a DecodeImage and ResizeImage events | 117 Tests the instrumentation of a DecodeImage and ResizeImage events |
| 118 </p> | 118 </p> |
| 119 </body> | 119 </body> |
| 120 </html> | 120 </html> |
| OLD | NEW |