[webkit-reviews] review denied: [Bug 31376] WebInspector: Adds test for Timeline EventDispatch record : [Attachment 43004] WebInspector: Adds EventDispatch test for Timeline records.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Nov 11 23:55:01 PST 2009


Pavel Feldman <pfeldman at chromium.org> has denied Eric Ayers
<zundel at google.com>'s request for review:
Bug 31376: WebInspector: Adds test for Timeline EventDispatch record
https://bugs.webkit.org/show_bug.cgi?id=31376

Attachment 43004: WebInspector: Adds EventDispatch test for Timeline records.
https://bugs.webkit.org/attachment.cgi?id=43004&action=review

------- Additional Comments from Pavel Feldman <pfeldman at chromium.org>

> +function findMarkTimeline(record) 
> +{
> +    if (record.type === timelineAgentRecordType.MarkTimeline &&
record.data.message === timelineMark)
> +	   return true;
> +    var numChildren = record.children ? record.children.length : 0;
> +    for (var i = 0; i < numChildren; ++i)
> +	   if (findMarkTimeline(record.children[i]))
> +	       return true;
> +    return false;
> +}
> +
> +function findEventDispatch(record, dispatchType)
> +{
> +    if (record.type === timelineAgentRecordType.EventDispatch &&
record.data.type === "mousedown")
> +	   if (findMarkTimeline(record)) {
> +	       printTimelineRecordProperties(record);
> +	       return true;
> +	   }
> +
> +    var numChildren = record.children ? record.children.length : 0;
> +    for (var i = 0; i < numChildren; ++i) {
> +	   var child = record.children[i];
> +	   if (findEventDispatch(child, dispatchType))
> +	       return true;
> +    }
> +    return false;
> +}
> +

See my comments to the previous patch. The ones above are again code
duplication.

> +
> +function analyzeTimelineData(timelineRecords)
> +{
> +    // Uncomment to debugging the list of data returned.
> +    // dumpTimelineRecords(timelineRecords);
> +
> +    var found = false;
> +    var numRecords = timelineRecords.length;
> +
> +    // Look for a mousedown EventDispatch that follows the mark
> +    for (var i = 0; i < numRecords; ++i) {
> +	   var record = timelineRecords[i];
> +	   found = findEventDispatch(record, "mousedown");
> +	   if (found)
> +	       break;
> +    }
> +    if (!found)
> +	   output("Did not find EventDispatch for mousedown");
> +}

And again.


More information about the webkit-reviews mailing list