Commit 1fcc3697 authored by Mike Jackson's avatar Mike Jackson Committed by Commit Bot

DevTools: Re-enable shadow-distribution.js test

This test was disabled when the IncrementalShadowDOM flag was turned on,
since it relied on the timing of the UpdateDistribution phase of ShadowDOM,
when dumping out the elements tree.

This change proposes that we force a style recalc in the test, to ensure
that the appropriate DOM domain events are sent and processed by the front end.
(e.g. ChildNodeCountUpdated, DistributedNodesChanged, AttrModified, etc).

Bug: 840238
Change-Id: I90207b8109c951e7c7b826cbce1b8f9e28143351
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1638851
Commit-Queue: Mike Jackson <mjackson@microsoft.com>
Reviewed-by: default avatarJoel Einbinder <einbinder@chromium.org>
Cr-Commit-Position: refs/heads/master@{#666553}
parent 04afa7b9
......@@ -1648,7 +1648,6 @@ crbug.com/891427 [ Mac Win7 ] virtual/mouseevent_fractional/fast/events/touch/ge
### sheriff 2018-05-28
crbug.com/840238 http/tests/devtools/elements/shadow/shadow-distribution.js [ Failure ]
crbug.com/767269 [ Win ] inspector-protocol/layout-fonts/cjk-ideograph-fallback-by-lang.js [ Pass Failure ]
......
......@@ -65,6 +65,14 @@
var parent = resolveElement(parentId);
parent.appendChild(element);
}
// In order for the elements tree to reflect the changes made during this test,
// there needs to be a step that ensures that Shadow DOM distributions are updated.
// Forcing a style recalc ensures that Shadow DOM distributions are updated, and that
// the relevant DevTools CDP events are sent to the front end.
function updateDistributionIfNeeded() {
getComputedStyle(document.documentElement).left;
}
`);
TestRunner.runTestSuite([
......@@ -134,7 +142,11 @@
]);
function evalAndDump(code, nodeId, next) {
TestRunner.evaluateInPage(code, ElementsTestRunner.expandElementsTree.bind(ElementsTestRunner, dump));
TestRunner.evaluateInPage(code, ElementsTestRunner.expandElementsTree.bind(ElementsTestRunner, callback));
function callback() {
TestRunner.evaluateInPage('updateDistributionIfNeeded()', ElementsTestRunner.expandElementsTree.bind(ElementsTestRunner, dump));
}
function dump() {
ElementsTestRunner.dumpElementsTree(ElementsTestRunner.expandedNodeWithId(nodeId));
......
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