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 WebInspector.inspectorView.showPanel("audits"); | 24 WebInspector.inspectorView.showPanel("audits"); |
25 InspectorTest.reloadPage(step1); | 25 InspectorTest.reloadPage(); |
| 26 InspectorTest.addSniffer(WebInspector.CSSStyleModel.prototype, "_styleSheetA
dded", onStyleSheetAdded, true); |
26 | 27 |
27 function step1() | 28 var pendingStyleSheetsCount = 5; |
| 29 function onStyleSheetAdded() |
28 { | 30 { |
| 31 if (--pendingStyleSheetsCount) |
| 32 return; |
29 WebInspector.AuditRuleResult.resourceDomain = function() { | 33 WebInspector.AuditRuleResult.resourceDomain = function() { |
30 return "[domain]"; | 34 return "[domain]"; |
31 }; | 35 }; |
32 | 36 |
33 InspectorTest.launchAllAudits(false, step2); | 37 InspectorTest.launchAllAudits(false, onAuditsFinished); |
34 } | 38 } |
35 | 39 |
36 function step2() | 40 function onAuditsFinished() |
37 { | 41 { |
38 InspectorTest.collectAuditResults(); | 42 InspectorTest.collectAuditResults(); |
39 InspectorTest.completeTest(); | 43 InspectorTest.completeTest(); |
40 } | 44 } |
41 } | 45 } |
42 </script> | 46 </script> |
43 </head> | 47 </head> |
44 | 48 |
45 <body onload="runTest()"> | 49 <body onload="runTest()"> |
46 Tests audit rules on a page without images. | 50 Tests audit rules on a page without images. |
47 <style> | 51 <style> |
48 .violation { color: red; } | 52 .violation { color: red; } |
49 </style> | 53 </style> |
50 <link rel="stylesheet" href="resources/audits-style1.css" type="text/css"> | 54 <link rel="stylesheet" href="resources/audits-style1.css" type="text/css"> |
51 </body> | 55 </body> |
52 </html> | 56 </html> |
OLD | NEW |