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

Side by Side Diff: third_party/WebKit/LayoutTests/inspector-protocol/resources/node-tracker.js

Issue 2955943002: DevTools: migrate inspector-protocol/dom tests to a new test runner (Closed)
Patch Set: rebaseline Created 3 years, 5 months 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
« no previous file with comments | « third_party/WebKit/LayoutTests/inspector-protocol/resources/inspector-protocol-test.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 (class NodeTracker {
2 constructor(dp) {
3 this._nodes = new Map();
4 dp.DOM.onSetChildNodes(message => message.params.nodes.forEach(node => this. _addNode(node)));
5 }
6
7 addDocumentNode(documentNode) {
8 this._addNode(documentNode);
9 }
10
11 _addNode(node) {
12 this._nodes.set(node.nodeId, node);
13 if (node.children)
14 node.children.forEach(node => this._addNode(node));
15 }
16
17 nodeForId(nodeId) {
18 return this._nodes.get(nodeId) || null;
19 }
20
21 nodes() {
22 return Array.from(this._nodes.values());
23 }
24
25 nodeIds() {
26 return Array.from(this._nodes.keys());
27 }
28 })
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/inspector-protocol/resources/inspector-protocol-test.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698