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

Unified Diff: LayoutTests/inspector/elements/styles-4/styles-source-offsets.html

Issue 1350183004: DevTools: CSS.getMatchedStylesForNode protocol command to return inline styles (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fix tests Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: LayoutTests/inspector/elements/styles-4/styles-source-offsets.html
diff --git a/LayoutTests/inspector/elements/styles-4/styles-source-offsets.html b/LayoutTests/inspector/elements/styles-4/styles-source-offsets.html
index 9cfc402e4ad58902b4615166153336682eb877cf..1cb6012476ed212f98df376d6598e5cdf99784dd 100644
--- a/LayoutTests/inspector/elements/styles-4/styles-source-offsets.html
+++ b/LayoutTests/inspector/elements/styles-4/styles-source-offsets.html
@@ -37,47 +37,19 @@ function test()
InspectorTest.addResult("['" + property.name + "':'" + property.value + "'" + (property.important ? " !important" : "") + (("parsedOk" in property) ? " non-parsed" : "") +"] @" + InspectorTest.rangeText(property.range));
}
}
-
- InspectorTest.selectNodeWithId("mainBody", step1);
-
- var resultStyles = {};
-
- function inlineCallback(error, inlineStyle)
- {
- if (error) {
- InspectorTest.addResult("error: " + error);
- InspectorTest.completeTest();
- return;
- }
- resultStyles.inlineStyle = inlineStyle;
- }
-
- function matchedCallback(error, matchedCSSRules)
- {
- if (error) {
- InspectorTest.addResult("error: " + error);
- InspectorTest.completeTest();
- return;
- }
- resultStyles.matchedCSSRules = matchedCSSRules;
- }
+ InspectorTest.selectNodeWithId("mainBody", step1);
function step1(node)
{
- var promises = [
- InspectorTest.CSSAgent.getInlineStylesForNode(node.id, inlineCallback),
- InspectorTest.CSSAgent.getMatchedStylesForNode(node.id, matchedCallback)
- ];
- Promise.all(promises).then(step2);
+ InspectorTest.CSSAgent.getMatchedStylesForNode(node.id, onMatchedStyles)
}
- function step2()
+ function onMatchedStyles(error, inlineStyle, attributeStyle, matchedCSSRules)
{
- var matchedCSSRules = resultStyles.matchedCSSRules;
for (var i = 0; i < matchedCSSRules.length; ++i)
dumpStyleData(matchedCSSRules[i].rule);
- dumpStyleData(resultStyles.inlineStyle);
+ dumpStyleData(inlineStyle);
InspectorTest.completeTest();
}
}
« no previous file with comments | « LayoutTests/inspector/elements/styles-4/styles-new-API.html ('k') | Source/core/inspector/InspectorCSSAgent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698