Commit 3ae920b1 authored by Arthur Sonzogni's avatar Arthur Sonzogni Committed by Commit Bot

Update DomTreeExtractionBrowserTest.

Assigned Node ID may not be the same for each executions of the test
DomTreeExtractionBrowserTest.RunAsyncTest. This CL clears the value of
backendNodeId to make this test more deterministic.

backendNodeId uses DOMNodIds::IdForNode(). Here are two stack traces
where the ID number 3 is assigned to a different Node.

02 blink::DOMNodeIds::IdForNode()
03 blink::InspectorDOMSnapshotAgent::VisitNode()
04 blink::InspectorDOMSnapshotAgent::VisitContainerChildren()
05 blink::InspectorDOMSnapshotAgent::VisitNode()
06 blink::InspectorDOMSnapshotAgent::getSnapshot()
07 blink::InspectorDOMSnapshotAgent::getSnapshot()
08 blink::protocol::DOMSnapshot::DispatcherImpl::getSnapshot()
09 blink::protocol::DOMSnapshot::DispatcherImpl::dispatch()
10 blink::protocol::UberDispatcher::dispatch()
11 blink::InspectorSession::DispatchProtocolMessage()
12 blink::WebDevToolsAgentImpl::Session::DispatchProtocolCommand()
13 blink::mojom::blink::DevToolsSessionStubDispatch::Accept()

02 blink::DOMNodeIds::IdForNode()
03 blink::CompositedLayerMapping::CreateGraphicsLayer()
04 blink::CompositedLayerMapping::CreatePrimaryGraphicsLayer()
05 blink::CompositedLayerMapping::CompositedLayerMapping()
06 blink::PaintLayer::EnsureCompositedLayerMapping()
07 blink::PaintLayerCompositor::AllocateOrClearCompositedLayerMapping()
08 blink::CompositingLayerAssigner::AssignLayersToBackingsInternal()
09 blink::CompositingLayerAssigner::Assign()
10 blink::PaintLayerCompositor::UpdateIfNeeded()
11 blink::PaintLayerCompositor::UpdateIfNeededRecursiveInternal()
12 blink::PaintLayerCompositor::UpdateIfNeededRecursive()
13 blink::LocalFrameView::UpdateLifecyclePhasesInternal()
14 blink::LocalFrameView::UpdateAllLifecyclePhases()
15 blink::PageAnimator::UpdateAllLifecyclePhases()
16 blink::PageWidgetDelegate::UpdateLifecycle()
17 blink::WebViewImpl::UpdateLifecycle()
18 blink::WebViewFrameWidget::UpdateLifecycle()
19 content::RenderWidget::UpdateVisualState()
20 content::RenderWidgetCompositor::UpdateLayerTreeHost()
21 cc::LayerTreeHost::RequestMainFrameUpdate()

Currently, this test doesn't appear to be flaky. I am working on:
https://crbug.com/831155. It causes the navigation to commit slightly
faster. The test fails one time out of four, all the backendNodeId in
getSnapshot() are shifted by one.

Bug: 831155
Change-Id: I83a30202877bb65953957438284062f13fabeb6c
Reviewed-on: https://chromium-review.googlesource.com/1101693Reviewed-by: default avatarAlex Clarke <alexclarke@chromium.org>
Reviewed-by: default avatarDmitry Gozman <dgozman@chromium.org>
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#567640}
parent f9a16504
{
"backendNodeId": 3,
"backendNodeId": "?",
"baseURL": "http://127.0.0.1/dom_tree_test.html",
"boundingBox": {
"height": 600.0,
......@@ -17,7 +17,7 @@
"nodeValue": ""
}
{
"backendNodeId": 4,
"backendNodeId": "?",
"boundingBox": {
"height": 600.0,
"width": 800.0,
......@@ -33,33 +33,33 @@
"styleIndex": 0
}
{
"backendNodeId": 5,
"backendNodeId": "?",
"childNodeIndexes": [ 3, 4, 6, 7, 8 ],
"nodeName": "HEAD",
"nodeType": 1,
"nodeValue": ""
}
{
"backendNodeId": 6,
"backendNodeId": "?",
"nodeName": "#text",
"nodeType": 3,
"nodeValue": "\n"
}
{
"backendNodeId": 7,
"backendNodeId": "?",
"childNodeIndexes": [ 5 ],
"nodeName": "TITLE",
"nodeType": 1,
"nodeValue": ""
}
{
"backendNodeId": 8,
"backendNodeId": "?",
"nodeName": "#text",
"nodeType": 3,
"nodeValue": "Hello world!"
}
{
"backendNodeId": 9,
"backendNodeId": "?",
"nodeName": "#text",
"nodeType": 3,
"nodeValue": "\n"
......@@ -75,25 +75,25 @@
"name": "type",
"value": "text/css"
} ],
"backendNodeId": 10,
"backendNodeId": "?",
"nodeName": "LINK",
"nodeType": 1,
"nodeValue": ""
}
{
"backendNodeId": 11,
"backendNodeId": "?",
"nodeName": "#text",
"nodeType": 3,
"nodeValue": "\n"
}
{
"backendNodeId": 12,
"backendNodeId": "?",
"nodeName": "#text",
"nodeType": 3,
"nodeValue": "\n"
}
{
"backendNodeId": 13,
"backendNodeId": "?",
"boundingBox": {
"height": 584.0,
"width": 784.0,
......@@ -108,7 +108,7 @@
"styleIndex": 1
}
{
"backendNodeId": 14,
"backendNodeId": "?",
"nodeName": "#text",
"nodeType": 3,
"nodeValue": "\n"
......@@ -118,7 +118,7 @@
"name": "id",
"value": "id1"
} ],
"backendNodeId": 15,
"backendNodeId": "?",
"boundingBox": {
"height": 354.0,
"width": 784.0,
......@@ -133,7 +133,7 @@
"styleIndex": 0
}
{
"backendNodeId": 16,
"backendNodeId": "?",
"nodeName": "#text",
"nodeType": 3,
"nodeValue": "\n"
......@@ -143,7 +143,7 @@
"name": "class",
"value": "red"
} ],
"backendNodeId": 17,
"backendNodeId": "?",
"boundingBox": {
"height": 32.0,
"width": 784.0,
......@@ -158,7 +158,7 @@
"styleIndex": 2
}
{
"backendNodeId": 18,
"backendNodeId": "?",
"boundingBox": {
"height": 32.0,
"width": 320.0,
......@@ -183,7 +183,7 @@
"styleIndex": 2
}
{
"backendNodeId": 19,
"backendNodeId": "?",
"nodeName": "#text",
"nodeType": 3,
"nodeValue": "\n"
......@@ -199,7 +199,7 @@
"name": "height",
"value": "200"
} ],
"backendNodeId": 20,
"backendNodeId": "?",
"boundingBox": {
"height": 205.0,
"width": 404.0,
......@@ -215,7 +215,7 @@
"styleIndex": 3
}
{
"backendNodeId": 21,
"backendNodeId": "?",
"baseURL": "http://127.0.0.1/iframe.html",
"boundingBox": {
"height": 200.0,
......@@ -233,7 +233,7 @@
"nodeValue": ""
}
{
"backendNodeId": 22,
"backendNodeId": "?",
"boundingBox": {
"height": 200.0,
"width": 400.0,
......@@ -249,13 +249,13 @@
"styleIndex": 4
}
{
"backendNodeId": 23,
"backendNodeId": "?",
"nodeName": "HEAD",
"nodeType": 1,
"nodeValue": ""
}
{
"backendNodeId": 24,
"backendNodeId": "?",
"boundingBox": {
"height": 171.0,
"width": 384.0,
......@@ -270,7 +270,7 @@
"styleIndex": 5
}
{
"backendNodeId": 25,
"backendNodeId": "?",
"nodeName": "#text",
"nodeType": 3,
"nodeValue": "\n"
......@@ -283,7 +283,7 @@
"name": ";\"",
"value": ""
} ],
"backendNodeId": 26,
"backendNodeId": "?",
"boundingBox": {
"height": 37.0,
"width": 384.0,
......@@ -298,7 +298,7 @@
"styleIndex": 6
}
{
"backendNodeId": 27,
"backendNodeId": "?",
"boundingBox": {
"height": 36.0,
"width": 308.0,
......@@ -323,13 +323,13 @@
"styleIndex": 6
}
{
"backendNodeId": 28,
"backendNodeId": "?",
"nodeName": "#text",
"nodeType": 3,
"nodeValue": "\n\n\n"
}
{
"backendNodeId": 29,
"backendNodeId": "?",
"boundingBox": {
"height": 0.0,
"width": 0.0,
......@@ -348,7 +348,7 @@
"name": "id",
"value": "id2"
} ],
"backendNodeId": 30,
"backendNodeId": "?",
"boundingBox": {
"height": 97.0,
"width": 784.0,
......@@ -363,7 +363,7 @@
"styleIndex": 0
}
{
"backendNodeId": 31,
"backendNodeId": "?",
"nodeName": "#text",
"nodeType": 3,
"nodeValue": "\n "
......@@ -373,7 +373,7 @@
"name": "id",
"value": "id3"
} ],
"backendNodeId": 32,
"backendNodeId": "?",
"boundingBox": {
"height": 97.0,
"width": 784.0,
......@@ -388,7 +388,7 @@
"styleIndex": 0
}
{
"backendNodeId": 33,
"backendNodeId": "?",
"nodeName": "#text",
"nodeType": 3,
"nodeValue": "\n "
......@@ -398,7 +398,7 @@
"name": "id",
"value": "id4"
} ],
"backendNodeId": 34,
"backendNodeId": "?",
"boundingBox": {
"height": 97.0,
"width": 784.0,
......@@ -413,7 +413,7 @@
"styleIndex": 0
}
{
"backendNodeId": 35,
"backendNodeId": "?",
"nodeName": "#text",
"nodeType": 3,
"nodeValue": "\n "
......@@ -423,7 +423,7 @@
"name": "href",
"value": "https://www.google.com"
} ],
"backendNodeId": 36,
"backendNodeId": "?",
"boundingBox": {
"height": 17.0,
"width": 112.0,
......@@ -439,7 +439,7 @@
"styleIndex": 7
}
{
"backendNodeId": 37,
"backendNodeId": "?",
"boundingBox": {
"height": 17.0,
"width": 112.0,
......@@ -464,7 +464,7 @@
"styleIndex": 7
}
{
"backendNodeId": 38,
"backendNodeId": "?",
"boundingBox": {
"height": 0.0,
"width": 0.0,
......@@ -479,7 +479,7 @@
"styleIndex": 0
}
{
"backendNodeId": 39,
"backendNodeId": "?",
"boundingBox": {
"height": 17.0,
"width": 784.0,
......@@ -494,7 +494,7 @@
"styleIndex": 8
}
{
"backendNodeId": 40,
"backendNodeId": "?",
"boundingBox": {
"height": 17.0,
"width": 192.0,
......@@ -519,13 +519,13 @@
"styleIndex": 8
}
{
"backendNodeId": 41,
"backendNodeId": "?",
"nodeName": "#text",
"nodeType": 3,
"nodeValue": "\n "
}
{
"backendNodeId": 42,
"backendNodeId": "?",
"boundingBox": {
"height": 17.0,
"width": 0.0,
......@@ -550,7 +550,7 @@
"styleIndex": 3
}
{
"backendNodeId": 43,
"backendNodeId": "?",
"nodeName": "#text",
"nodeType": 3,
"nodeValue": "\n "
......@@ -560,7 +560,7 @@
"name": "class",
"value": "green"
} ],
"backendNodeId": 44,
"backendNodeId": "?",
"boundingBox": {
"height": 17.0,
"width": 784.0,
......@@ -575,7 +575,7 @@
"styleIndex": 9
}
{
"backendNodeId": 45,
"backendNodeId": "?",
"boundingBox": {
"height": 17.0,
"width": 80.0,
......@@ -600,7 +600,7 @@
"styleIndex": 9
}
{
"backendNodeId": 46,
"backendNodeId": "?",
"boundingBox": {
"height": 17.0,
"width": 80.0,
......@@ -615,7 +615,7 @@
"styleIndex": 10
}
{
"backendNodeId": 47,
"backendNodeId": "?",
"boundingBox": {
"height": 17.0,
"width": 80.0,
......@@ -640,7 +640,7 @@
"styleIndex": 10
}
{
"backendNodeId": 48,
"backendNodeId": "?",
"boundingBox": {
"height": 17.0,
"width": 128.0,
......@@ -665,25 +665,25 @@
"styleIndex": 9
}
{
"backendNodeId": 49,
"backendNodeId": "?",
"nodeName": "#text",
"nodeType": 3,
"nodeValue": "\n "
}
{
"backendNodeId": 50,
"backendNodeId": "?",
"nodeName": "#text",
"nodeType": 3,
"nodeValue": "\n "
}
{
"backendNodeId": 51,
"backendNodeId": "?",
"nodeName": "#text",
"nodeType": 3,
"nodeValue": "\n"
}
{
"backendNodeId": 52,
"backendNodeId": "?",
"nodeName": "#text",
"nodeType": 3,
"nodeValue": "\n\n\n"
......
......@@ -1291,6 +1291,10 @@ class DomTreeExtractionBrowserTest : public HeadlessAsyncDevTooledBrowserTest,
static_cast<base::DictionaryValue*>(node->Serialize().release()));
base::DictionaryValue* node_dict = dom_nodes[i].get();
// Node IDs are assigned in a non deterministic way.
if (node_dict->FindKey("backendNodeId"))
node_dict->SetString("backendNodeId", "?");
// Frame IDs are random.
if (node_dict->FindKey("frameId"))
node_dict->SetString("frameId", "?");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment