7359e9a5e03a66e01e73da7e92c8d627084f2774
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / inspector / audits / audits-panel-functional.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2 <html>
3 <head>
4 <style>
5 @media all {
6
7 /* This is a comment to use some space before the unused rule */
8
9 .unused {
10     color: green;
11     -webkit-opacity: 1;
12     opacity: 1;
13 }
14
15 x:before { color: black }
16 x:nth-child(1):hover:after { color: black }
17 x:after { color: black }
18 x:hover { color: black }
19 x:first-letter { color: black }
20 x:nth-child(2n + 1) { color: black }
21
22 /* These rules should NOT be reported as unused */
23
24 a:visited { text-decoration: none }
25
26 img::before { color: red }
27 img:after { color: red }
28
29 img:hover { border: 1px solid black }
30 img:focus { border: 1px solid black }
31 img:active { border: 1px solid black }
32
33 span:first-letter { color: red }
34
35 img:nth-child(2n) { border: 1px solid blue }
36 img:nth-child(2n + 1) { border: 1px solid green }
37 img:nth-child(1):hover:after { border: 1px solid cyan }
38
39 }
40 </style>
41 <script>
42 JSON = {};
43 </script>
44 <script src="../../http/tests/inspector/inspector-test.js"></script>
45 <script src="audits-test.js"></script>
46
47 <!-- These scripts are needed to result in a violation of the max JS resource count from the same domain -->
48 <script src="resources/audits-script1.js"></script>
49 <link rel="stylesheet" href="resources/audits-style1.css" type="text/css">
50 <script src="resources/audits-script2.js"></script>
51 <script>
52 var test = function()
53 {
54     WebInspector.inspectorView.showPanel("audits");
55     InspectorTest.reloadPage();
56     var pendingStyleSheetsCount = 4;
57     InspectorTest.addSniffer(WebInspector.CSSStyleModel.prototype, "_styleSheetAdded", onStyleSheetLoaded, true);
58
59     function onStyleSheetLoaded()
60     {
61         if (--pendingStyleSheetsCount)
62             return;
63         WebInspector.AuditRuleResult.resourceDomain = function() {
64             return "[domain]";
65         };
66
67         InspectorTest.launchAllAudits(false, onAuditsFinished);
68     }
69
70     function onAuditsFinished()
71     {
72         InspectorTest.collectAuditResults();
73         InspectorTest.completeTest();
74     }
75 }
76 </script>
77 </head>
78
79 <body onload="runTest()">
80 <p>Tests audit rules.</p>
81 <style>
82 .violation { color: red; -webkit-border-radius: 3px; }
83 </style>
84 <link rel="stylesheet" href="resources/audits-style1.css" type="text/css">
85 <img src="foo1.jpg">
86 <img src="foo2.jpg" width=100>
87 <img src="foo3.jpg" style="position: absolute">
88 <img src="foo4.jpg" style="width: 16px; height: 16px">
89 <span>Text</span>
90 <a>Link</a>
91
92 </body>
93 </html>