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

Side by Side Diff: third_party/WebKit/LayoutTests/inspector-protocol/css/css-get-rule-list.html

Issue 2455943003: Backend for css rule tracking (Closed)
Patch Set: Backend for CSS Rule tracking. Created 4 years, 1 month 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/inspector-protocol/css/css-get-rule-list-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <html>
2 <head>
3 <script type="text/javascript" src="../../http/tests/inspector-protocol/inspecto r-protocol-test.js"></script>
4 <script type="text/javascript" src="../../http/tests/inspector-protocol/css-prot ocol-test.js"></script>
5 <script type="text/javascript" src="../../http/tests/inspector-protocol/dom-prot ocol-test.js"></script>
6 <script type="text/javascript">
7 function test()
8 {
9 InspectorTest.sendCommandOrDie("DOM.enable", {});
10 InspectorTest.sendCommandOrDie("CSS.enable", {}, () => InspectorTest.runTest Suite(testSuite));
11
12 var testSuite = [
13 function testGetRuleListAfterStartingRecording(next)
14 {
15 InspectorTest.sendCommandOrDie("CSS.startRuleUsageTracking", {}, () =>
16 { InspectorTest.sendCommandOrDie("CSS .stopRuleUsageTracking", {}, ruleListLoaded); });
17
18 function ruleListLoaded(result)
19 {
20 if(!result) {
21 next();
22 return;
23 }
24 var rules = result.ruleUsage;
25 var usedLines = rules.filter(rule => rule.used);
26 var unusedLines = rules.filter(rule => !rule.used);
27
28 usedLines.sort();
29 unusedLines.sort();
30 InspectorTest.log("=== Size of array: " + rules.length);
31 InspectorTest.log(" Number of used Rules: " + usedLines.length );
32 for(var line of usedLines)
33 InspectorTest.log(line.range.startLine);
34
35 InspectorTest.log(" Number of unused Rules: " + unusedLines.le ngth);
36 for(var line of unusedLines)
37 InspectorTest.log(line.range.startLine);
38
39 next();
40 }
41 }
42 ];
43 }
44
45 </script>
46 <link rel="stylesheet" href="resources/get-rule-list.css">
47 </head>
48 <body onload="runTest();">
49 <h1 class="class">Class Selector</h1>
50 <p id="id">ID Selector</p>
51 <div></div>
52
53 </body>
54 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/inspector-protocol/css/css-get-rule-list-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698