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

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

Issue 2484903002: DevTools: fix a crash in stopRuleUsageTracking (Closed)
Patch Set: stopRuleUsageTracking crash fixed 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/cssom-modify-rule-and-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
4 <style>
5 #modifyRule {
6 box-sizing: border-box;
7 }
8
9 #modifyRule {
10 height: 100%;
11 }
12
13 #modifyRule {
14 width: 100%;
15 }
16 </style>
17
18 <script type="text/javascript" src="../../http/tests/inspector-protocol/inspecto r-protocol-test.js"></script>
19 <script type="text/javascript" src="../../http/tests/inspector-protocol/css-prot ocol-test.js"></script>
20 <script type="text/javascript" src="../../http/tests/inspector-protocol/dom-prot ocol-test.js"></script>
21 <script type="text/javascript">
22
23 function test()
24 {
25 var documentNodeId;
26
27 InspectorTest.requestDocumentNodeId(onDocumentNodeId);
28
29 function onDocumentNodeId(nodeId)
30 {
31 documentNodeId = nodeId;
32 InspectorTest.sendCommandOrDie("DOM.enable", {});
33 InspectorTest.sendCommandOrDie("CSS.enable", {}, function() {
34 InspectorTest.sendCommandOrDie("CSS.startRuleUsageTracking", {}, () =>
35 { testModifyRule(); })
36 });
37 }
38
39 function testModifyRule()
40 {
41 InspectorTest.evaluateInPage("document.styleSheets[0].rules[0].style.set Property('color', 'red')");
42 InspectorTest.evaluateInPage("document.styleSheets[0].rules[2].style.set Property('color', 'blue')");
43 InspectorTest.evaluateInPage("document.styleSheets[0].rules[1].style.set Property('color', 'green')");
44
45 InspectorTest.sendCommandOrDie("CSS.stopRuleUsageTracking", {}, ruleList Loaded);
46 function ruleListLoaded(result) {
47 if(!result) {
48 return;
49 }
50 var rules = result.ruleUsage;
51 var usedLines = rules.filter(rule => rule.used);
52 var unusedLines = rules.filter(rule => !rule.used);
53
54 usedLines.sort();
55 unusedLines.sort();
56 InspectorTest.log("=== Size of array: " + rules.length);
57 InspectorTest.log(" Number of used Rules: " + usedLines.length);
58 for(var line of usedLines)
59 InspectorTest.log(line.range.startLine);
60
61 InspectorTest.log(" Number of unused Rules: " + unusedLines.length );
62 for(var line of unusedLines)
63 InspectorTest.log(line.range.startLine);
64
65 InspectorTest.completeTest();
66 }
67 }
68 }
69
70 </script>
71 </head>
72 <body onload="runTest();">
73 <p>The test verifies that CSS.stopRuleUsageTracking doesn't crash when used conc urrently with the CSSOM modifications.</p>
74 <article id="modifyRule"></article>
75 </body>
76 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/inspector-protocol/css/cssom-modify-rule-and-get-rule-list-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698