OLD | NEW |
1 function emptyFontFaceDeclarations() | 1 function emptyFontFaceDeclarations() |
2 { | 2 { |
3 var stylesheet = document.styleSheets[0]; | 3 var stylesheet = document.styleSheets[0]; |
4 var rules = stylesheet.cssRules; | 4 var rules = stylesheet.cssRules; |
5 var rulesLengthSnapshot = stylesheet.cssRules.length; | 5 var rulesLengthSnapshot = stylesheet.cssRules.length; |
6 if (!rulesLengthSnapshot) | 6 if (!rulesLengthSnapshot) |
7 return; | 7 return; |
8 for (var i = 0; i < rulesLengthSnapshot; i++) { | 8 for (var i = 0; i < rulesLengthSnapshot; i++) { |
9 stylesheet.deleteRule(0); | 9 stylesheet.deleteRule(0); |
10 } | 10 } |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 | 176 |
177 function testNextPageElement(result) | 177 function testNextPageElement(result) |
178 { | 178 { |
179 var nextSelector = testSelectors.shift() | 179 var nextSelector = testSelectors.shift() |
180 if (nextSelector) { | 180 if (nextSelector) { |
181 documentNodeSelector = "#" + nextSelector; | 181 documentNodeSelector = "#" + nextSelector; |
182 platformFontsForElementWithSelector(documentNodeSelector); | 182 platformFontsForElementWithSelector(documentNodeSelector); |
183 } | 183 } |
184 } | 184 } |
185 | 185 |
186 async function platformFontsForElementWithSelector(selector) | 186 function platformFontsForElementWithSelector(selector) |
187 { | 187 { |
188 var nodeId = await InspectorTest.requestNodeId(documentNodeId, selector)
; | 188 InspectorTest.requestNodeId(documentNodeId, selector, onNodeId); |
189 await InspectorTest.sendCommandOrDie("CSS.enable", {}); | 189 |
190 var response = await InspectorTest.sendCommandOrDie("CSS.getPlatformFont
sForNode", | 190 function onNodeId(nodeId) |
191 { nodeId: nodeId }); | 191 { |
192 logResults(response); | 192 InspectorTest.sendCommandOrDie("CSS.getPlatformFontsForNode", |
193 nextTest(); | 193 { nodeId: nodeId }, |
| 194 onGotComputedFonts); |
| 195 } |
| 196 |
| 197 function onGotComputedFonts(response) |
| 198 { |
| 199 logResults(response); |
| 200 nextTest(); |
| 201 } |
194 } | 202 } |
195 | 203 |
196 function logResults(response) | 204 function logResults(response) |
197 { | 205 { |
198 InspectorTest.log(documentNodeSelector); | 206 InspectorTest.log(documentNodeSelector); |
199 logPassFailResult( | 207 logPassFailResult( |
200 documentNodeSelector, | 208 documentNodeSelector, |
201 response.fonts[0].familyName); | 209 response.fonts[0].familyName); |
202 } | 210 } |
203 | 211 |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 InspectorTest.log("FAIL\n"); | 275 InspectorTest.log("FAIL\n"); |
268 } else { | 276 } else { |
269 InspectorTest.log("PASS\n"); | 277 InspectorTest.log("PASS\n"); |
270 } | 278 } |
271 } | 279 } |
272 }; | 280 }; |
273 | 281 |
274 window.addEventListener("DOMContentLoaded", function () { | 282 window.addEventListener("DOMContentLoaded", function () { |
275 runTest(); | 283 runTest(); |
276 }, false); | 284 }, false); |
OLD | NEW |