[Webkit-unassigned] [Bug 31376] WebInspector: Adds test for Timeline EventDispatch record

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


https://bugs.webkit.org/show_bug.cgi?id=31376


Pavel Feldman <pfeldman at chromium.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #43004|review?                     |review-
               Flag|                            |




--- Comment #2 from Pavel Feldman <pfeldman at chromium.org>  2009-11-11 23:55:02 PST ---
(From update of attachment 43004)

> +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.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list