| 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 InspectorTest.reloadPage(onPageReloaded); | 54 InspectorTest.reloadPage(onPageReloaded); |
| 55 var pendingStyleSheetsCount = 4; | 55 var pendingStyleSheetsCount = 4; |
| 56 InspectorTest.addSniffer(WebInspector.CSSModel.prototype, "_styleSheetAdded"
, maybeStylesheetsLoaded, true); | 56 InspectorTest.addSniffer(SDK.CSSModel.prototype, "_styleSheetAdded", maybeSt
ylesheetsLoaded, true); |
| 57 | 57 |
| 58 var pageReloaded = false; | 58 var pageReloaded = false; |
| 59 function onPageReloaded() | 59 function onPageReloaded() |
| 60 { | 60 { |
| 61 pageReloaded = true; | 61 pageReloaded = true; |
| 62 maybeStylesheetsLoaded(); | 62 maybeStylesheetsLoaded(); |
| 63 } | 63 } |
| 64 | 64 |
| 65 function maybeStylesheetsLoaded() | 65 function maybeStylesheetsLoaded() |
| 66 { | 66 { |
| 67 if (!pageReloaded) | 67 if (!pageReloaded) |
| 68 return; | 68 return; |
| 69 if (InspectorTest.cssModel.styleSheetHeaders().length !== pendingStyleSh
eetsCount) | 69 if (InspectorTest.cssModel.styleSheetHeaders().length !== pendingStyleSh
eetsCount) |
| 70 return; | 70 return; |
| 71 WebInspector.AuditRuleResult.resourceDomain = function() { | 71 Audits.AuditRuleResult.resourceDomain = function() { |
| 72 return "[domain]"; | 72 return "[domain]"; |
| 73 }; | 73 }; |
| 74 | 74 |
| 75 InspectorTest.launchAllAudits(false, onAuditsFinished); | 75 InspectorTest.launchAllAudits(false, onAuditsFinished); |
| 76 } | 76 } |
| 77 | 77 |
| 78 function onAuditsFinished() | 78 function onAuditsFinished() |
| 79 { | 79 { |
| 80 InspectorTest.collectAuditResults(InspectorTest.completeTest); | 80 InspectorTest.collectAuditResults(InspectorTest.completeTest); |
| 81 } | 81 } |
| 82 } | 82 } |
| 83 </script> | 83 </script> |
| 84 </head> | 84 </head> |
| 85 | 85 |
| 86 <body onload="runTest()"> | 86 <body onload="runTest()"> |
| 87 <p>Tests audit rules.</p> | 87 <p>Tests audit rules.</p> |
| 88 <style> | 88 <style> |
| 89 .violation { color: red; -webkit-border-radius: 3px; } | 89 .violation { color: red; -webkit-border-radius: 3px; } |
| 90 </style> | 90 </style> |
| 91 <link rel="stylesheet" href="resources/audits-style1.css" type="text/css"> | 91 <link rel="stylesheet" href="resources/audits-style1.css" type="text/css"> |
| 92 <img src="foo1.jpg"> | 92 <img src="foo1.jpg"> |
| 93 <img src="foo2.jpg" width=100> | 93 <img src="foo2.jpg" width=100> |
| 94 <img src="foo3.jpg" style="position: absolute"> | 94 <img src="foo3.jpg" style="position: absolute"> |
| 95 <img src="foo4.jpg" style="width: 16px; height: 16px"> | 95 <img src="foo4.jpg" style="width: 16px; height: 16px"> |
| 96 <span>Text</span> | 96 <span>Text</span> |
| 97 <a>Link</a> | 97 <a>Link</a> |
| 98 | 98 |
| 99 </body> | 99 </body> |
| 100 </html> | 100 </html> |
| OLD | NEW |