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 function platformFontsForElementWithSelector(selector) | 186 async function platformFontsForElementWithSelector(selector) |
187 { | 187 { |
188 InspectorTest.requestNodeId(documentNodeId, selector, onNodeId); | 188 var nodeId = await InspectorTest.requestNodeId(documentNodeId, selector)
; |
189 | 189 await InspectorTest.sendCommandOrDie("CSS.enable", {}); |
190 function onNodeId(nodeId) | 190 var response = await InspectorTest.sendCommandOrDie("CSS.getPlatformFont
sForNode", |
191 { | 191 { nodeId: nodeId }); |
192 InspectorTest.sendCommandOrDie("CSS.getPlatformFontsForNode", | 192 logResults(response); |
193 { nodeId: nodeId }, | 193 nextTest(); |
194 onGotComputedFonts); | |
195 } | |
196 | |
197 function onGotComputedFonts(response) | |
198 { | |
199 logResults(response); | |
200 nextTest(); | |
201 } | |
202 } | 194 } |
203 | 195 |
204 function logResults(response) | 196 function logResults(response) |
205 { | 197 { |
206 InspectorTest.log(documentNodeSelector); | 198 InspectorTest.log(documentNodeSelector); |
207 logPassFailResult( | 199 logPassFailResult( |
208 documentNodeSelector, | 200 documentNodeSelector, |
209 response.fonts[0].familyName); | 201 response.fonts[0].familyName); |
210 } | 202 } |
211 | 203 |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 InspectorTest.log("FAIL\n"); | 267 InspectorTest.log("FAIL\n"); |
276 } else { | 268 } else { |
277 InspectorTest.log("PASS\n"); | 269 InspectorTest.log("PASS\n"); |
278 } | 270 } |
279 } | 271 } |
280 }; | 272 }; |
281 | 273 |
282 window.addEventListener("DOMContentLoaded", function () { | 274 window.addEventListener("DOMContentLoaded", function () { |
283 runTest(); | 275 runTest(); |
284 }, false); | 276 }, false); |
OLD | NEW |