Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(239)

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/inspector/security/security-state-comparator.html

Issue 2493373002: DevTools: rename WebInspector into modules. (Closed)
Patch Set: for bots Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 Protocol.Security.SecurityState.Info, 9 Protocol.Security.SecurityState.Info,
10 Protocol.Security.SecurityState.Insecure, 10 Protocol.Security.SecurityState.Insecure,
11 Protocol.Security.SecurityState.Neutral, 11 Protocol.Security.SecurityState.Neutral,
12 Protocol.Security.SecurityState.Warning, 12 Protocol.Security.SecurityState.Warning,
13 Protocol.Security.SecurityState.Secure, 13 Protocol.Security.SecurityState.Secure,
14 Protocol.Security.SecurityState.Unknown 14 Protocol.Security.SecurityState.Unknown
15 ]; 15 ];
16 16
17 InspectorTest.assertEquals(ordering.length, Object.keys(Protocol.Security.Se curityState).length); 17 InspectorTest.assertEquals(ordering.length, Object.keys(Protocol.Security.Se curityState).length);
18 18
19 for (var i = 0; i < ordering.length; i++) { 19 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] + "\""); 20 InspectorTest.assertEquals(Security.SecurityModel.SecurityStateComparato r(ordering[i], ordering[i]), 0, "Security state comparison failed when checking that \"" + ordering[i] + "\" == \"" + ordering[i] + "\"");
21 } 21 }
22 22
23 for (var i = 0; i < ordering.length; i++) { 23 for (var i = 0; i < ordering.length; i++) {
24 var j; 24 var j;
25 25
26 for (j = 0; j < i; j++) { 26 for (j = 0; j < i; j++) {
27 InspectorTest.addResult("Sign of SecurityStateComparator(\"" + order ing[i] + "\",\"" + ordering[j] + "\"): " + Math.sign(WebInspector.SecurityModel. SecurityStateComparator(ordering[i], ordering[j])) + " (expected: 1)"); 27 InspectorTest.addResult("Sign of SecurityStateComparator(\"" + order ing[i] + "\",\"" + ordering[j] + "\"): " + Math.sign(Security.SecurityModel.Secu rityStateComparator(ordering[i], ordering[j])) + " (expected: 1)");
28 } 28 }
29 29
30 InspectorTest.addResult("Sign of SecurityStateComparator(\"" + ordering[ i] + "\",\"" + ordering[j] + "\"): " + Math.sign(WebInspector.SecurityModel.Secu rityStateComparator(ordering[i], ordering[j])) + " (expected: 0)"); 30 InspectorTest.addResult("Sign of SecurityStateComparator(\"" + ordering[ i] + "\",\"" + ordering[j] + "\"): " + Math.sign(Security.SecurityModel.Security StateComparator(ordering[i], ordering[j])) + " (expected: 0)");
31 31
32 for (j = i + 1; j < ordering.length; j++) { 32 for (j = i + 1; j < ordering.length; j++) {
33 InspectorTest.addResult("Sign of SecurityStateComparator(\"" + order ing[i] + "\",\"" + ordering[j] + "\"): " + Math.sign(WebInspector.SecurityModel. SecurityStateComparator(ordering[i], ordering[j])) + " (expected: -1)"); 33 InspectorTest.addResult("Sign of SecurityStateComparator(\"" + order ing[i] + "\",\"" + ordering[j] + "\"): " + Math.sign(Security.SecurityModel.Secu rityStateComparator(ordering[i], ordering[j])) + " (expected: -1)");
34 } 34 }
35 } 35 }
36 36
37 InspectorTest.completeTest(); 37 InspectorTest.completeTest();
38 } 38 }
39 </script> 39 </script>
40 </head> 40 </head>
41 <body onload="runTest()"> 41 <body onload="runTest()">
42 <p>Tests that SecurityStateComparator correctly compares the severity of securit y states.</p> 42 <p>Tests that SecurityStateComparator correctly compares the severity of securit y states.</p>
43 </body> 43 </body>
44 </html> 44 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698