| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script src="../inspector-test.js"></script> | 3 <script src="../inspector-test.js"></script> |
| 4 <!-- Since we are testing a static function, we can save work by not (pre)loadin
g the Security panel. --> | 4 <!-- Since we are testing a static function, we can save work by not (pre)loadin
g the Security panel. --> |
| 5 <script> | 5 <script> |
| 6 function test() | 6 function test() |
| 7 { | 7 { |
| 8 var ordering = [ | 8 var ordering = [ |
| 9 SecurityAgent.SecurityState.Info, | 9 SecurityAgent.SecurityState.Info, |
| 10 SecurityAgent.SecurityState.Insecure, | 10 SecurityAgent.SecurityState.Insecure, |
| 11 SecurityAgent.SecurityState.Neutral, | 11 SecurityAgent.SecurityState.Neutral, |
| 12 SecurityAgent.SecurityState.Warning, | |
| 13 SecurityAgent.SecurityState.Secure, | 12 SecurityAgent.SecurityState.Secure, |
| 14 SecurityAgent.SecurityState.Unknown | 13 SecurityAgent.SecurityState.Unknown |
| 15 ]; | 14 ]; |
| 16 | 15 |
| 17 InspectorTest.assertEquals(ordering.length, Object.keys(SecurityAgent.Securi
tyState).length); | 16 InspectorTest.assertEquals(ordering.length, Object.keys(SecurityAgent.Securi
tyState).length); |
| 18 | 17 |
| 19 for (var i = 0; i < ordering.length; i++) { | 18 for (var i = 0; i < ordering.length; i++) { |
| 20 InspectorTest.assertEquals(WebInspector.SecurityModel.SecurityStateCompa
rator(ordering[i], ordering[i]), 0, "Security state comparison failed when check
ing that \"" + ordering[i] + "\" == \"" + ordering[i] + "\""); | 19 InspectorTest.assertEquals(WebInspector.SecurityModel.SecurityStateCompa
rator(ordering[i], ordering[i]), 0, "Security state comparison failed when check
ing that \"" + ordering[i] + "\" == \"" + ordering[i] + "\""); |
| 21 } | 20 } |
| 22 | 21 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 35 } | 34 } |
| 36 | 35 |
| 37 InspectorTest.completeTest(); | 36 InspectorTest.completeTest(); |
| 38 } | 37 } |
| 39 </script> | 38 </script> |
| 40 </head> | 39 </head> |
| 41 <body onload="runTest()"> | 40 <body onload="runTest()"> |
| 42 <p>Tests that SecurityStateComparator correctly compares the severity of securit
y states.</p> | 41 <p>Tests that SecurityStateComparator correctly compares the severity of securit
y states.</p> |
| 43 </body> | 42 </body> |
| 44 </html> | 43 </html> |
| OLD | NEW |