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

Side by Side Diff: LayoutTests/inspector-protocol/css/css-protocol-test.js

Issue 317703002: DevTools: add test to verify matched styles for :host selector (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | LayoutTests/inspector-protocol/css/css-shadow-host-rule.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 function initialize_cssTest() 1 function initialize_cssTest()
2 { 2 {
3 3
4 InspectorTest.dumpStyleSheetText = function(styleSheetId, callback) 4 InspectorTest.dumpStyleSheetText = function(styleSheetId, callback)
5 { 5 {
6 InspectorTest.sendCommandOrDie("CSS.getStyleSheetText", { styleSheetId: styl eSheetId }, onStyleSheetText); 6 InspectorTest.sendCommandOrDie("CSS.getStyleSheetText", { styleSheetId: styl eSheetId }, onStyleSheetText);
7 function onStyleSheetText(result) 7 function onStyleSheetText(result)
8 { 8 {
9 InspectorTest.log("==== Style sheet text ===="); 9 InspectorTest.log("==== Style sheet text ====");
10 InspectorTest.log(result.text); 10 InspectorTest.log(result.text);
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 log(4, propertyLine); 113 log(4, propertyLine);
114 } 114 }
115 log(0, "}"); 115 log(0, "}");
116 }; 116 };
117 117
118 InspectorTest.displayName = function(url) 118 InspectorTest.displayName = function(url)
119 { 119 {
120 return url.substr(url.lastIndexOf("/") + 1); 120 return url.substr(url.lastIndexOf("/") + 1);
121 }; 121 };
122 122
123 InspectorTest.loadAndDumpMatchingRules = function(nodeId, callback) 123 InspectorTest.loadAndDumpMatchingRulesForNode = function(nodeId, callback)
124 { 124 {
125 InspectorTest.requestNodeId(nodeId, nodeIdLoaded); 125 InspectorTest.sendCommandOrDie("CSS.getMatchedStylesForNode", { "nodeId": no deId }, matchingRulesLoaded);
126
127 function nodeIdLoaded(nodeId)
128 {
129 InspectorTest.sendCommandOrDie("CSS.getMatchedStylesForNode", { "nodeId" : nodeId }, matchingRulesLoaded);
130 }
131 126
132 function matchingRulesLoaded(result) 127 function matchingRulesLoaded(result)
133 { 128 {
134 InspectorTest.log("Dumping matched rules: "); 129 InspectorTest.log("Dumping matched rules: ");
135 var ruleMatches = result.matchedCSSRules; 130 var ruleMatches = result.matchedCSSRules;
136 for (var i = 0; i < ruleMatches.length; ++i) { 131 for (var i = 0; i < ruleMatches.length; ++i) {
137 var ruleMatch = ruleMatches[i]; 132 var ruleMatch = ruleMatches[i];
138 var origin = ruleMatch.rule.origin; 133 var origin = ruleMatch.rule.origin;
139 if (origin !== "inspector" && origin !== "regular") 134 if (origin !== "inspector" && origin !== "regular")
140 continue; 135 continue;
141 InspectorTest.dumpRuleMatch(ruleMatch); 136 InspectorTest.dumpRuleMatch(ruleMatch);
142 } 137 }
143 callback(); 138 callback();
144 } 139 }
145 } 140 }
146 141
142 InspectorTest.loadAndDumpMatchingRules = function(selector, callback)
143 {
144 InspectorTest.requestNodeId(selector, nodeIdLoaded);
145
146 function nodeIdLoaded(nodeId)
147 {
148 InspectorTest.loadAndDumpMatchingRulesForNode(nodeId, callback);
149 }
150 }
151
147 } 152 }
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/inspector-protocol/css/css-shadow-host-rule.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698