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 var mixedContentStatus = { ranInsecureContent: false, displayedInsecureConte
nt: false}; | 8 var mixedContentStatus = { ranInsecureContent: false, displayedInsecureConte
nt: false}; |
9 | 9 |
10 InspectorTest.mainTarget.model(WebInspector.SecurityModel).dispatchEventToLi
steners(WebInspector.SecurityModel.EventTypes.SecurityStateChanged, new WebInspe
ctor.PageSecurityState(SecurityAgent.SecurityState.Secure, [], mixedContentStatu
s, true)); | 10 // Explanations from https://cbc.badssl.com/ as of 2016-06-13. |
| 11 // We explicitly place the explanation with the security state "info" |
| 12 // first to make sure it gets reordered. |
| 13 var explanations = [ |
| 14 { |
| 15 "description": "Public-key pinning was bypassed by a local root cert
ificate.", |
| 16 "securityState": "info", |
| 17 "summary": "Public-Key Pinning Bypassed" |
| 18 }, |
| 19 { |
| 20 "certificateId": 1, |
| 21 "description": "The connection to this site is using a valid, truste
d server certificate.", |
| 22 "securityState": "secure", |
| 23 "summary": "Valid Certificate" |
| 24 } |
| 25 ]; |
| 26 |
| 27 InspectorTest.mainTarget.model(WebInspector.SecurityModel).dispatchEventToLi
steners(WebInspector.SecurityModel.EventTypes.SecurityStateChanged, new WebInspe
ctor.PageSecurityState(SecurityAgent.SecurityState.Secure, explanations, mixedCo
ntentStatus, true)); |
11 | 28 |
12 var request = new WebInspector.NetworkRequest(InspectorTest.mainTarget, 0, "
http://foo.test", "https://foo.test", 0, 0, null); | 29 var request = new WebInspector.NetworkRequest(InspectorTest.mainTarget, 0, "
http://foo.test", "https://foo.test", 0, 0, null); |
13 InspectorTest.dispatchRequestFinished(request); | 30 InspectorTest.dispatchRequestFinished(request); |
14 | 31 |
15 var explanations = WebInspector.SecurityPanel._instance()._mainView.contentE
lement.getElementsByClassName("security-explanation"); | 32 var explanations = WebInspector.SecurityPanel._instance()._mainView.contentE
lement.getElementsByClassName("security-explanation"); |
16 for (var i = 0; i < explanations.length; i++) | 33 for (var i = 0; i < explanations.length; i++) |
17 InspectorTest.dumpDeepInnerHTML(explanations[i]); | 34 InspectorTest.dumpDeepInnerHTML(explanations[i]); |
18 InspectorTest.completeTest(); | 35 InspectorTest.completeTest(); |
19 } | 36 } |
20 </script> | 37 </script> |
21 </head> | 38 </head> |
22 <body onload="runTest()"> | 39 <body onload="runTest()"> |
23 <p>Tests addition of explanation when all page resources are transferred securel
y (no-mixed-content).</p> | 40 <p>Tests that info explanations are placed after regular explanations.</p> |
24 </body> | 41 </body> |
25 </html> | 42 </html> |
OLD | NEW |