| 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 .unused { | 5 .unused { |
| 6 color: green; | 6 color: green; |
| 7 } | 7 } |
| 8 </style> | 8 </style> |
| 9 <link rel="stylesheet" href="resources/audits-style1.css" type="text/css"> | 9 <link rel="stylesheet" href="resources/audits-style1.css" type="text/css"> |
| 10 <script>function foo() { }</script> | 10 <script>function foo() { }</script> |
| 11 <link rel="stylesheet" href="resources/audits-style1.css" type="text/css"> | 11 <link rel="stylesheet" href="resources/audits-style1.css" type="text/css"> |
| 12 <script> | 12 <script> |
| 13 JSON = {}; | 13 JSON = {}; |
| 14 </script> | 14 </script> |
| 15 <script src="../../http/tests/inspector/inspector-test.js"></script> | 15 <script src="../../http/tests/inspector/inspector-test.js"></script> |
| 16 <script src="audits-test.js"></script> | 16 <script src="audits-test.js"></script> |
| 17 | 17 |
| 18 <!-- These scripts are needed to result in a violation of the max JS resource co
unt from the same domain --> | 18 <!-- These scripts are needed to result in a violation of the max JS resource co
unt from the same domain --> |
| 19 <script src="resources/audits-script1.js"></script> | 19 <script src="resources/audits-script1.js"></script> |
| 20 <script src="resources/audits-script2.js"></script> | 20 <script src="resources/audits-script2.js"></script> |
| 21 <script> | 21 <script> |
| 22 var test = function() | 22 var test = function() |
| 23 { | 23 { |
| 24 InspectorTest.reloadPage(); | 24 InspectorTest.reloadPage(); |
| 25 InspectorTest.addSniffer(WebInspector.CSSModel.prototype, "_styleSheetAdded"
, onStyleSheetAdded, true); | 25 InspectorTest.addSniffer(SDK.CSSModel.prototype, "_styleSheetAdded", onStyle
SheetAdded, true); |
| 26 | 26 |
| 27 var pendingStyleSheetsCount = 5; | 27 var pendingStyleSheetsCount = 5; |
| 28 function onStyleSheetAdded() | 28 function onStyleSheetAdded() |
| 29 { | 29 { |
| 30 if (--pendingStyleSheetsCount) | 30 if (--pendingStyleSheetsCount) |
| 31 return; | 31 return; |
| 32 WebInspector.AuditRuleResult.resourceDomain = function() { | 32 Audits.AuditRuleResult.resourceDomain = function() { |
| 33 return "[domain]"; | 33 return "[domain]"; |
| 34 }; | 34 }; |
| 35 | 35 |
| 36 InspectorTest.launchAllAudits(false, onAuditsFinished); | 36 InspectorTest.launchAllAudits(false, onAuditsFinished); |
| 37 } | 37 } |
| 38 | 38 |
| 39 function onAuditsFinished() | 39 function onAuditsFinished() |
| 40 { | 40 { |
| 41 InspectorTest.collectAuditResults(InspectorTest.completeTest); | 41 InspectorTest.collectAuditResults(InspectorTest.completeTest); |
| 42 } | 42 } |
| 43 } | 43 } |
| 44 </script> | 44 </script> |
| 45 </head> | 45 </head> |
| 46 | 46 |
| 47 <body onload="runTest()"> | 47 <body onload="runTest()"> |
| 48 Tests audit rules on a page without images. | 48 Tests audit rules on a page without images. |
| 49 <style> | 49 <style> |
| 50 .violation { color: red; } | 50 .violation { color: red; } |
| 51 </style> | 51 </style> |
| 52 <link rel="stylesheet" href="resources/audits-style1.css" type="text/css"> | 52 <link rel="stylesheet" href="resources/audits-style1.css" type="text/css"> |
| 53 </body> | 53 </body> |
| 54 </html> | 54 </html> |
| OLD | NEW |