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

Side by Side Diff: third_party/WebKit/LayoutTests/inspector/tracing/decode-resize.html

Issue 2486853002: Timeline: remove TimelineModel inferred properties from TracingModel.Event (Closed)
Patch Set: addressed comments and rebased Created 4 years, 1 month 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 <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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 === WebInspector.TimelineModel.RecordType.DecodeIm age;
86 } 86 }
87 function compareImageURLs(a, b) 87 function compareImageURLs(a, b)
88 { 88 {
89 var urlA = InspectorTest.formatters.formatAsURL(a.url || "<missing>" ); 89 var urlA = WebInspector.TimelineData.forEvent(a).url;
90 var urlB = InspectorTest.formatters.formatAsURL(b.url || "<missing>" ); 90 var urlB = WebInspector.TimelineData.forEvent(b).url;
91 urlA = InspectorTest.formatters.formatAsURL(urlA || "<missing>");
92 urlB = InspectorTest.formatters.formatAsURL(urlB || "<missing>");
91 return urlA.localeCompare(urlB); 93 return urlA.localeCompare(urlB);
92 } 94 }
93 var events = InspectorTest.timelineModel().inspectedTargetEvents(); 95 var events = InspectorTest.timelineModel().inspectedTargetEvents();
94 var sortedDecodeEvents = events.filter(isDecodeImageEvent).sort(compareI mageURLs); 96 var sortedDecodeEvents = events.filter(isDecodeImageEvent).sort(compareI mageURLs);
95 for (var i = 0; i < sortedDecodeEvents.length; ++i) { 97 for (var i = 0; i < sortedDecodeEvents.length; ++i) {
96 var event = sortedDecodeEvents[i]; 98 var event = sortedDecodeEvents[i];
99 var timlelineData = WebInspector.TimelineData.forEvent(event);
100 var url = timlelineData.url;
97 // Skip duplicate events, as long as they have the imageURL 101 // Skip duplicate events, as long as they have the imageURL
98 if (i && event.url && event.url === sortedDecodeEvents[i - 1].url) 102 if (i && url && url === WebInspector.TimelineData.forEvent(sortedDec odeEvents[i - 1]).url)
99 continue; 103 continue;
100 InspectorTest.addResult("event: " + event.name); 104 InspectorTest.addResult("event: " + event.name);
101 InspectorTest.addResult("imageURL: " + InspectorTest.formatters.form atAsURL(event.url)); 105 InspectorTest.addResult("imageURL: " + InspectorTest.formatters.form atAsURL(url));
102 InspectorTest.addResult("backendNodeId: " + (event.backendNodeId > 0 ? "present" : "absent")); 106 InspectorTest.addResult("backendNodeId: " + (timlelineData.backendNo deId > 0 ? "present" : "absent"));
103 } 107 }
104 InspectorTest.completeTest(); 108 InspectorTest.completeTest();
105 } 109 }
106 } 110 }
107 111
108 </script> 112 </script>
109 </head> 113 </head>
110 114
111 <body onload="runTest()"> 115 <body onload="runTest()">
112 <p> 116 <p>
113 Tests the instrumentation of a DecodeImage and ResizeImage events 117 Tests the instrumentation of a DecodeImage and ResizeImage events
114 </p> 118 </p>
115 </body> 119 </body>
116 </html> 120 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698