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 <script src="../security-test.js"></script> | 4 <script src="../security-test.js"></script> |
5 <script> | 5 <script> |
6 function test() | 6 function test() |
7 { | 7 { |
8 /** @type {!SecurityAgent.InsecureContentStatus} */ | 8 /** @type {!SecurityAgent.InsecureContentStatus} */ |
9 var insecureContentStatus = { ranMixedContent: false, displayedMixedContent:
false, ranContentWithCertErrors: false, displayedContentWithCertErrors: false,
ranInsecureContentStyle: SecurityAgent.SecurityState.Insecure, displayedInsecure
ContentStyle: SecurityAgent.SecurityState.Neutral }; | 9 var insecureContentStatus = { ranMixedContent: false, displayedMixedContent:
false, ranContentWithCertErrors: false, displayedContentWithCertErrors: false,
ranInsecureContentStyle: SecurityAgent.SecurityState.Insecure, displayedInsecure
ContentStyle: SecurityAgent.SecurityState.Neutral }; |
10 | 10 |
11 // Explanations from https://cbc.badssl.com/ as of 2016-06-13. | 11 // Explanations from https://cbc.badssl.com/ as of 2016-06-13. |
12 // We explicitly place the explanation with the security state "info" | 12 // We explicitly place the explanation with the security state "info" |
13 // first to make sure it gets reordered. | 13 // first to make sure it gets reordered. |
14 var explanations = [ | 14 var explanations = [ |
15 { | 15 { |
16 "description": "Public-key pinning was bypassed by a local root cert
ificate.", | 16 "description": "Public-key pinning was bypassed by a local root cert
ificate.", |
17 "securityState": "info", | 17 "securityState": "info", |
18 "summary": "Public-Key Pinning Bypassed" | 18 "summary": "Public-Key Pinning Bypassed" |
19 }, | 19 }, |
20 { | 20 { |
21 "certificateId": 1, | 21 "hasCertificate": "true", |
22 "description": "The connection to this site is using a valid, truste
d server certificate.", | 22 "description": "The connection to this site is using a valid, truste
d server certificate.", |
23 "securityState": "secure", | 23 "securityState": "secure", |
24 "summary": "Valid Certificate" | 24 "summary": "Valid Certificate" |
25 }, | 25 }, |
26 { | 26 { |
27 "description": "The connection to this site uses a strong protocol (
TLS 1.2), a strong key exchange (ECDHE_RSA), and an obsolete cipher (AES_256_CBC
with HMAC-SHA1).", | 27 "description": "The connection to this site uses a strong protocol (
TLS 1.2), a strong key exchange (ECDHE_RSA), and an obsolete cipher (AES_256_CBC
with HMAC-SHA1).", |
28 "securityState": "secure", | 28 "securityState": "secure", |
29 "summary": "Obsolete Connection Settings" | 29 "summary": "Obsolete Connection Settings" |
30 | 30 |
31 } | 31 } |
32 ]; | 32 ]; |
33 | 33 |
34 InspectorTest.mainTarget.model(WebInspector.SecurityModel).dispatchEventToLi
steners(WebInspector.SecurityModel.Events.SecurityStateChanged, new WebInspector
.PageSecurityState(SecurityAgent.SecurityState.Secure, explanations, insecureCon
tentStatus, true)); | 34 InspectorTest.mainTarget.model(WebInspector.SecurityModel).dispatchEventToLi
steners(WebInspector.SecurityModel.Events.SecurityStateChanged, new WebInspector
.PageSecurityState(SecurityAgent.SecurityState.Secure, explanations, insecureCon
tentStatus, true)); |
35 | 35 |
36 var request = new WebInspector.NetworkRequest(InspectorTest.mainTarget, 0, "
http://foo.test", "https://foo.test", 0, 0, null); | 36 var request = new WebInspector.NetworkRequest(InspectorTest.mainTarget, 0, "
http://foo.test", "https://foo.test", 0, 0, null); |
37 InspectorTest.dispatchRequestFinished(request); | 37 InspectorTest.dispatchRequestFinished(request); |
38 | 38 |
39 var explanations = WebInspector.SecurityPanel._instance()._mainView.contentE
lement.getElementsByClassName("security-explanation"); | 39 var explanations = WebInspector.SecurityPanel._instance()._mainView.contentE
lement.getElementsByClassName("security-explanation"); |
40 for (var i = 0; i < explanations.length; i++) | 40 for (var i = 0; i < explanations.length; i++) |
41 InspectorTest.dumpDeepInnerHTML(explanations[i]); | 41 InspectorTest.dumpDeepInnerHTML(explanations[i]); |
42 InspectorTest.completeTest(); | 42 InspectorTest.completeTest(); |
43 } | 43 } |
44 </script> | 44 </script> |
45 </head> | 45 </head> |
46 <body onload="runTest()"> | 46 <body onload="runTest()"> |
47 <p>Tests that info explanations are placed after regular explanations.</p> | 47 <p>Tests that info explanations are placed after regular explanations.</p> |
48 </body> | 48 </body> |
49 </html> | 49 </html> |
OLD | NEW |