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

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

Issue 450533008: DevTools: fix inspector-protocol css tests (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 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
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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 InspectorTest.requestDocumentNodeId = function(callback) 58 InspectorTest.requestDocumentNodeId = function(callback)
59 { 59 {
60 InspectorTest.sendCommandOrDie("DOM.getDocument", {}, onGotDocument); 60 InspectorTest.sendCommandOrDie("DOM.getDocument", {}, onGotDocument);
61 61
62 function onGotDocument(result) 62 function onGotDocument(result)
63 { 63 {
64 callback(result.root.nodeId); 64 callback(result.root.nodeId);
65 } 65 }
66 }; 66 };
67 67
68 InspectorTest.requestNodeId = function(selector, callback) 68 InspectorTest.requestNodeId = function(documentNodeId, selector, callback)
69 { 69 {
70 InspectorTest.requestDocumentNodeId(onGotDocumentNodeId); 70 InspectorTest.sendCommandOrDie("DOM.querySelector", { "nodeId": documentNode Id , "selector": selector }, onGotNode);
71
72 function onGotDocumentNodeId(documentNodeId)
73 {
74 InspectorTest.sendCommandOrDie("DOM.querySelector", { "nodeId": document NodeId , "selector": selector }, onGotNode);
75 }
76 71
77 function onGotNode(result) 72 function onGotNode(result)
78 { 73 {
79 callback(result.nodeId); 74 callback(result.nodeId);
80 } 75 }
81 }; 76 };
82 77
83 InspectorTest.dumpRuleMatch = function(ruleMatch) 78 InspectorTest.dumpRuleMatch = function(ruleMatch)
84 { 79 {
85 function log(indent, string) 80 function log(indent, string)
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 var ruleMatch = ruleMatches[i]; 127 var ruleMatch = ruleMatches[i];
133 var origin = ruleMatch.rule.origin; 128 var origin = ruleMatch.rule.origin;
134 if (origin !== "inspector" && origin !== "regular") 129 if (origin !== "inspector" && origin !== "regular")
135 continue; 130 continue;
136 InspectorTest.dumpRuleMatch(ruleMatch); 131 InspectorTest.dumpRuleMatch(ruleMatch);
137 } 132 }
138 callback(); 133 callback();
139 } 134 }
140 } 135 }
141 136
142 InspectorTest.loadAndDumpMatchingRules = function(selector, callback) 137 InspectorTest.loadAndDumpMatchingRules = function(documentNodeId, selector, call back)
143 { 138 {
144 InspectorTest.requestNodeId(selector, nodeIdLoaded); 139 InspectorTest.requestNodeId(documentNodeId, selector, nodeIdLoaded);
145 140
146 function nodeIdLoaded(nodeId) 141 function nodeIdLoaded(nodeId)
147 { 142 {
148 InspectorTest.loadAndDumpMatchingRulesForNode(nodeId, callback); 143 InspectorTest.loadAndDumpMatchingRulesForNode(nodeId, callback);
149 } 144 }
150 } 145 }
151 146
152 } 147 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698