WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
87009
Web Inspector: introduce a helper for HeapSnapshot post-processing tests.
https://bugs.webkit.org/show_bug.cgi?id=87009
Summary
Web Inspector: introduce a helper for HeapSnapshot post-processing tests.
Ilya Tikhonovsky
Reported
2012-05-21 05:19:59 PDT
We have many post processing steps but the test coverage is poor. The helper will simplify the snapshot mocking process. It will have two public classes InspectorTest.HeapSnapshotBuilder and InspectorTest.HeapNode and node/edge type constants. the sample: var builder = new InspectorTest.HeapSnapshotBuilder(); var debuggerNode = new InspectorTest.HeapNode("Debugger"); builder.rootNode.linkNode(debuggerNode, InspectorTest.HeapEdge.element); var windowNode = new InspectorTest.HeapNode("Window"); builder.rootNode.linkNode(windowNode, InspectorTest.HeapEdge.shortcut); debuggerNode.linkNode(windowNode, InspectorTest.HeapEdge.property, "windowProperty"); return builder.generateSnapshot();
Attachments
Patch
(11.36 KB, patch)
2012-05-21 05:22 PDT
,
Ilya Tikhonovsky
no flags
Details
Formatted Diff
Diff
Patch
(10.39 KB, patch)
2012-05-21 07:06 PDT
,
Ilya Tikhonovsky
no flags
Details
Formatted Diff
Diff
Patch
(10.43 KB, patch)
2012-05-21 07:13 PDT
,
Ilya Tikhonovsky
yurys
: review+
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Ilya Tikhonovsky
Comment 1
2012-05-21 05:22:44 PDT
Created
attachment 143007
[details]
Patch
Yury Semikhatsky
Comment 2
2012-05-21 05:38:44 PDT
Comment on
attachment 143007
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=143007&action=review
> LayoutTests/inspector/profiler/heap-snapshot-test.js:384 > + this._strings2id = {};
_strings2id -> _string2id
> LayoutTests/inspector/profiler/heap-snapshot-test.js:423 > + InspectorTest.HeapNode.hidden,
We should make sure the types here are ordered as their values above. Please either use node_types[this._nodeTypes[n]] = n to fill this array or use this._nodeTypes[n] = node_types.indexOf(n) to initialize type constants.
> LayoutTests/inspector/profiler/heap-snapshot-test.js:496 > + this._strings2id[string] = this._nextStringId++;
Can this._strings.length be used as id?
> LayoutTests/inspector/profiler/heap-snapshot-test.js:510 > +InspectorTest.HeapNode.hidden = "hidden";
Should be InspectorTest.HeapNode.Type = { "hidden": "hidden",... }
> LayoutTests/inspector/profiler/heap-snapshot-test.js:532 > + if (nameOrIndex in this._edges)
this._edges is an array of InspectorTest.HeapEdge instances while nameOrIndex is a string or number. The condition looks wrong.
> LayoutTests/inspector/profiler/heap-snapshot-test.js:550 > + rawSnapshot.nodes.push(this._ordinal * 2 + 1); // id
You should add a comment explaining why the ids should be odd.
> LayoutTests/inspector/profiler/heap-snapshot-test.js:580 > +InspectorTest.HeapEdge.context = "context";
InspectorTest.HeapEdge.Type
> LayoutTests/inspector/profiler/heap-snapshot-test.js:587 > +InspectorTest.createFlagsTestSnapshot = function(instanceCount)
Consider putting this into the test file as it is used only once.
Ilya Tikhonovsky
Comment 3
2012-05-21 07:06:50 PDT
Created
attachment 143029
[details]
Patch
Ilya Tikhonovsky
Comment 4
2012-05-21 07:13:42 PDT
Created
attachment 143030
[details]
Patch
Ilya Tikhonovsky
Comment 5
2012-05-21 07:14:51 PDT
View in context:
https://bugs.webkit.org/attachment.cgi?id=143007&action=review
>> LayoutTests/inspector/profiler/heap-snapshot-test.js:384 >> + this._strings2id = {}; > > _strings2id -> _string2id
done
>> LayoutTests/inspector/profiler/heap-snapshot-test.js:423 >> + InspectorTest.HeapNode.hidden, > > We should make sure the types here are ordered as their values above. Please either use > node_types[this._nodeTypes[n]] = n > to fill this array or use this._nodeTypes[n] = node_types.indexOf(n) to initialize type constants.
done
>> LayoutTests/inspector/profiler/heap-snapshot-test.js:496 >> + this._strings2id[string] = this._nextStringId++; > > Can this._strings.length be used as id?
done
>> LayoutTests/inspector/profiler/heap-snapshot-test.js:510 >> +InspectorTest.HeapNode.hidden = "hidden"; > > Should be InspectorTest.HeapNode.Type = { > "hidden": "hidden",... > }
done
>> LayoutTests/inspector/profiler/heap-snapshot-test.js:532 >> + if (nameOrIndex in this._edges) > > this._edges is an array of InspectorTest.HeapEdge instances while nameOrIndex is a string or number. The condition looks wrong.
done
>> LayoutTests/inspector/profiler/heap-snapshot-test.js:550 >> + rawSnapshot.nodes.push(this._ordinal * 2 + 1); // id > > You should add a comment explaining why the ids should be odd.
done
>> LayoutTests/inspector/profiler/heap-snapshot-test.js:580 >> +InspectorTest.HeapEdge.context = "context"; > > InspectorTest.HeapEdge.Type
done
>> LayoutTests/inspector/profiler/heap-snapshot-test.js:587 >> +InspectorTest.createFlagsTestSnapshot = function(instanceCount) > > Consider putting this into the test file as it is used only once.
done
Yury Semikhatsky
Comment 6
2012-05-21 07:30:54 PDT
Comment on
attachment 143030
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=143030&action=review
> LayoutTests/inspector/profiler/heap-snapshot-test.js:385 > + this._size = size || 0;
_size => _selfSize?
> LayoutTests/inspector/profiler/heap-snapshot-test.js:434 > + rawSnapshot.nodes.push(this._ordinal * 2 + 1); // id has to be odd for the consistency with backend implementation.
Please state explicitly that we differentiate between JS nodes and DOM groups by the oddity of the id.
> LayoutTests/inspector/profiler/heap-snapshot-test.js:447 > + this._node = node;
_node => _targetNode
> LayoutTests/inspector/profiler/heap-snapshot.html:135 > + debuggerNode.linkNode(debuggerOwnedNode, InspectorTest.HeapEdge.Type.element);
Wrong alignment.
Ilya Tikhonovsky
Comment 7
2012-05-21 07:48:40 PDT
Committed
r117780
: <
http://trac.webkit.org/changeset/117780
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug