Commit 21f772b0 authored by Alex Rudenko's avatar Alex Rudenko Committed by Commit Bot

Re-enable http/tests/devtools/elements/styles-1/color-aware-property-value-edit.js

Re-enables the test and fixes it to account for async rendering of the
styles panel.

Bug: chromium:1075869
Change-Id: Ia148e6dc7e99a29fd14df22ea3f80253bdd10827
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2412731
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: default avatarMathias Bynens <mathias@chromium.org>
Cr-Commit-Position: refs/heads/master@{#807403}
parent 3c6ea938
...@@ -1788,9 +1788,6 @@ crbug.com/1051044 external/wpt/css/filter-effects/effect-reference-feimage-003.h ...@@ -1788,9 +1788,6 @@ crbug.com/1051044 external/wpt/css/filter-effects/effect-reference-feimage-003.h
crbug.com/524160 [ Debug ] http/tests/media/media-source/stream_memory_tests/mediasource-appendbuffer-quota-exceeded-default-buffers.html [ Timeout ] crbug.com/524160 [ Debug ] http/tests/media/media-source/stream_memory_tests/mediasource-appendbuffer-quota-exceeded-default-buffers.html [ Timeout ]
# Awaiting DevTools roll.
crbug.com/1075869 http/tests/devtools/elements/styles-1/color-aware-property-value-edit.js [ Pass Failure Timeout ]
# On these platforms (all but Android) media tests don't currently use gpu-accelerated (proprietary) codecs, so no # On these platforms (all but Android) media tests don't currently use gpu-accelerated (proprietary) codecs, so no
# benefit to running them again with gpu acceleration enabled. # benefit to running them again with gpu acceleration enabled.
crbug.com/555703 [ Linux ] virtual/media-gpu-accelerated/* [ Skip ] crbug.com/555703 [ Linux ] virtual/media-gpu-accelerated/* [ Skip ]
......
...@@ -19,38 +19,38 @@ ...@@ -19,38 +19,38 @@
}, },
function editKeywordAsOriginal(next) { function editKeywordAsOriginal(next) {
startEditingAndDumpValue(Common.Color.Format.Original, 'border', next); startEditingAndDumpValue('inspected1', Common.Color.Format.Original, 'border', next);
}, },
function editKeywordAsHex(next) { function editKeywordAsHex(next) {
startEditingAndDumpValue(Common.Color.Format.HEX, 'border', next); startEditingAndDumpValue('inspected1', Common.Color.Format.HEX, 'border', next);
}, },
function editKeywordAsHSL(next) { function editKeywordAsHSL(next) {
startEditingAndDumpValue(Common.Color.Format.HSL, 'border', next); startEditingAndDumpValue('inspected1', Common.Color.Format.HSL, 'border', next);
}, },
function editKeywordAsRGB(next) { function editKeywordAsRGB(next) {
startEditingAndDumpValue(Common.Color.Format.RGB, 'border', onValueDumped); startEditingAndDumpValue('inspected1', Common.Color.Format.RGB, 'border', onValueDumped);
function onValueDumped() { function onValueDumped() {
ElementsTestRunner.selectNodeAndWaitForStyles('inspected2', next); ElementsTestRunner.selectNodeAndWaitForStyles('inspected2', next);
} }
}, },
function editHexAsOriginal(next) { function editHexAsOriginal(next) {
startEditingAndDumpValue(Common.Color.Format.Original, 'color', next); startEditingAndDumpValue('inspected2', Common.Color.Format.Original, 'color', next);
}, },
function editHexAsHex(next) { function editHexAsHex(next) {
startEditingAndDumpValue(Common.Color.Format.HEX, 'color', next); startEditingAndDumpValue('inspected2', Common.Color.Format.HEX, 'color', next);
}, },
function editHexAsHSL(next) { function editHexAsHSL(next) {
startEditingAndDumpValue(Common.Color.Format.HSL, 'color', next); startEditingAndDumpValue('inspected2', Common.Color.Format.HSL, 'color', next);
}, },
function editHexAsRGB(next) { function editHexAsRGB(next) {
startEditingAndDumpValue(Common.Color.Format.RGB, 'color', next); startEditingAndDumpValue('inspected2', Common.Color.Format.RGB, 'color', next);
}, },
async function editNewProperty(next) { async function editNewProperty(next) {
...@@ -75,15 +75,22 @@ ...@@ -75,15 +75,22 @@
UI.panels.elements._stylesWidget.doUpdate().then(callback); UI.panels.elements._stylesWidget.doUpdate().then(callback);
} }
function startEditingAndDumpValue(format, propertyName, next) { function startEditingAndDumpValue(nodeId, format, propertyName, next) {
setFormat(format, onFormatSet); setFormat(format, onFormatSet);
function onFormatSet() { async function onFormatSet() {
await waitForStylesRebuild();
treeElement = ElementsTestRunner.getElementStylePropertyTreeItem(propertyName); treeElement = ElementsTestRunner.getElementStylePropertyTreeItem(propertyName);
treeElement.startEditing(treeElement.valueElement); treeElement.startEditing(treeElement.valueElement);
TestRunner.addResult(treeElement.valueElement.textContent); TestRunner.addResult(treeElement.valueElement.textContent);
treeElement.valueElement.dispatchEvent(TestRunner.createKeyEvent('Escape')); treeElement.valueElement.dispatchEvent(TestRunner.createKeyEvent('Escape'));
next(); next();
} }
function waitForStylesRebuild(node) {
if (node && node.getAttribute('id') === nodeId)
return;
return TestRunner.addSnifferPromise(Elements.StylesSidebarPane.prototype, '_nodeStylesUpdatedForTest').then(waitForStylesRebuild);
}
} }
})(); })();
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