| OLD | NEW |
| 1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.or
g/TR/html4/loose.dtd"> | 1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.or
g/TR/html4/loose.dtd"> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <style> | 4 <style> |
| 5 @media all { | 5 @media all { |
| 6 | 6 |
| 7 /* This is a comment to use some space before the unused rule */ | 7 /* This is a comment to use some space before the unused rule */ |
| 8 | 8 |
| 9 .unused { | 9 .unused { |
| 10 color: green; | 10 color: green; |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 <script src="audits-test.js"></script> | 45 <script src="audits-test.js"></script> |
| 46 | 46 |
| 47 <!-- These scripts are needed to result in a violation of the max JS resource co
unt from the same domain --> | 47 <!-- These scripts are needed to result in a violation of the max JS resource co
unt from the same domain --> |
| 48 <script src="resources/audits-script1.js"></script> | 48 <script src="resources/audits-script1.js"></script> |
| 49 <link rel="stylesheet" href="resources/audits-style1.css" type="text/css"> | 49 <link rel="stylesheet" href="resources/audits-style1.css" type="text/css"> |
| 50 <script src="resources/audits-script2.js"></script> | 50 <script src="resources/audits-script2.js"></script> |
| 51 <script> | 51 <script> |
| 52 var test = function() | 52 var test = function() |
| 53 { | 53 { |
| 54 WebInspector.inspectorView.showPanel("audits"); | 54 WebInspector.inspectorView.showPanel("audits"); |
| 55 InspectorTest.reloadPage(step1); | 55 InspectorTest.reloadPage(); |
| 56 var pendingStyleSheetsCount = 4; |
| 57 InspectorTest.addSniffer(WebInspector.CSSStyleModel.prototype, "_styleSheetA
dded", onStyleSheetLoaded, true); |
| 56 | 58 |
| 57 function step1() | 59 function onStyleSheetLoaded() |
| 58 { | 60 { |
| 61 if (--pendingStyleSheetsCount) |
| 62 return; |
| 59 WebInspector.AuditRuleResult.resourceDomain = function() { | 63 WebInspector.AuditRuleResult.resourceDomain = function() { |
| 60 return "[domain]"; | 64 return "[domain]"; |
| 61 }; | 65 }; |
| 62 | 66 |
| 63 InspectorTest.launchAllAudits(false, step2); | 67 InspectorTest.launchAllAudits(false, onAuditsFinished); |
| 64 } | 68 } |
| 65 | 69 |
| 66 function step2() | 70 function onAuditsFinished() |
| 67 { | 71 { |
| 68 InspectorTest.collectAuditResults(); | 72 InspectorTest.collectAuditResults(); |
| 69 InspectorTest.completeTest(); | 73 InspectorTest.completeTest(); |
| 70 } | 74 } |
| 71 } | 75 } |
| 72 </script> | 76 </script> |
| 73 </head> | 77 </head> |
| 74 | 78 |
| 75 <body onload="runTest()"> | 79 <body onload="runTest()"> |
| 76 <p>Tests audit rules.</p> | 80 <p>Tests audit rules.</p> |
| 77 <style> | 81 <style> |
| 78 .violation { color: red; -webkit-border-radius: 3px; } | 82 .violation { color: red; -webkit-border-radius: 3px; } |
| 79 </style> | 83 </style> |
| 80 <link rel="stylesheet" href="resources/audits-style1.css" type="text/css"> | 84 <link rel="stylesheet" href="resources/audits-style1.css" type="text/css"> |
| 81 <img src="foo1.jpg"> | 85 <img src="foo1.jpg"> |
| 82 <img src="foo2.jpg" width=100> | 86 <img src="foo2.jpg" width=100> |
| 83 <img src="foo3.jpg" style="position: absolute"> | 87 <img src="foo3.jpg" style="position: absolute"> |
| 84 <img src="foo4.jpg" style="width: 16px; height: 16px"> | 88 <img src="foo4.jpg" style="width: 16px; height: 16px"> |
| 85 <span>Text</span> | 89 <span>Text</span> |
| 86 <a>Link</a> | 90 <a>Link</a> |
| 87 | 91 |
| 88 </body> | 92 </body> |
| 89 </html> | 93 </html> |
| OLD | NEW |