| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script src="../../http/tests/inspector/inspector-test.js"></script> | 3 <script src="../../http/tests/inspector/inspector-test.js"></script> |
| 4 <script src="../../http/tests/inspector/elements-test.js"></script> | 4 <script src="../../http/tests/inspector/elements-test.js"></script> |
| 5 | 5 |
| 6 <link rel="stylesheet" type="text/css" href="resources/highlight-in-source.css"> | 6 <link rel="stylesheet" type="text/css" href="resources/highlight-in-source.css"> |
| 7 | 7 |
| 8 <script> | 8 <script> |
| 9 | 9 |
| 10 var initialize_CSSTracker = function() { | 10 var initialize_CSSTracker = function() { |
| 11 InspectorTest.preloadModule("css_tracker"); | 11 InspectorTest.preloadModule("css_tracker"); |
| 12 } | 12 } |
| 13 | 13 |
| 14 function test() | 14 function test() |
| 15 { | 15 { |
| 16 InspectorTest.addSniffer(CSSTracker.CSSTrackerView.prototype, "_onGotStyleSh
eets", displayResults); | 16 InspectorTest.addSniffer(CSSTracker.CSSTrackerView.prototype, "_updateTree",
displayResults); |
| 17 | 17 |
| 18 var tracker = self.runtime.sharedInstance(CSSTracker.CSSTrackerView); | 18 var tracker = self.runtime.sharedInstance(CSSTracker.CSSTrackerView); |
| 19 | 19 |
| 20 tracker._toggleRecording(true); | 20 tracker._toggleRecording(true); |
| 21 UI.viewManager.showView("css_tracker"); | 21 UI.viewManager.showView("css_tracker"); |
| 22 tracker._toggleRecording(false); | 22 tracker._toggleRecording(false); |
| 23 | 23 |
| 24 function displayResults() | 24 function displayResults() |
| 25 { | 25 { |
| 26 tracker._treeOutline.rootElement().firstChild().expand(); | 26 tracker._treeOutline.rootElement().firstChild().expand(); |
| 27 | 27 |
| 28 InspectorTest.addResult(tracker._treeOutline.element.shadowRoot.querySel
ectorAll( | 28 InspectorTest.addResult(tracker._treeOutline.element.shadowRoot.querySel
ectorAll( |
| 29 ".rule-result-matches-count")[0].innerHTML); | 29 ".rule-result-matches-count")[0].innerHTML); |
| 30 tracker._treeOutline.element.shadowRoot.querySelectorAll(".rule-match-co
ntent").forEach( | 30 tracker._treeOutline.element.shadowRoot.querySelectorAll(".rule-match-co
ntent").forEach( |
| 31 match => InspectorTest.addResult(match.innerHTML)); | 31 match => InspectorTest.addResult(match.innerHTML)); |
| 32 | 32 |
| 33 InspectorTest.completeTest(); | 33 InspectorTest.completeTest(); |
| 34 } | 34 } |
| 35 } | 35 } |
| 36 | 36 |
| 37 </script> | 37 </script> |
| 38 </head> | 38 </head> |
| 39 | 39 |
| 40 <body onload="runTest()"> | 40 <body onload="runTest()"> |
| 41 <p class="class"> | 41 <p class="class"> |
| 42 Tests the unused CSS list after finishing recording in the CSSTracker view. | 42 Tests the unused CSS list after finishing recording in the CSSTracker view. |
| 43 </p> | 43 </p> |
| 44 | 44 |
| 45 </body> | 45 </body> |
| 46 </html> | 46 </html> |
| OLD | NEW |