OLD | NEW |
(Empty) | |
| 1 <html> |
| 2 <head> |
| 3 <script src="../inspector-test.js"></script> |
| 4 <script src="../security-test.js"></script> |
| 5 <script> |
| 6 function test() |
| 7 { |
| 8 /** @type {!SecurityAgent.InsecureContentStatus} */ |
| 9 var insecureContentStatus = { ranMixedContent: true, displayedMixedContent:
true, ranContentWithCertErrors: false, displayedContentWithCertErrors: false, ra
nInsecureContentStyle: SecurityAgent.SecurityState.Insecure, displayedInsecureCo
ntentStyle: SecurityAgent.SecurityState.Neutral }; |
| 10 |
| 11 InspectorTest.mainTarget.model(WebInspector.SecurityModel).dispatchEventToLi
steners(WebInspector.SecurityModel.Events.SecurityStateChanged, new WebInspector
.PageSecurityState(SecurityAgent.SecurityState.Neutral, [], insecureContentStatu
s, true)); |
| 12 |
| 13 // At this point, the page has mixed content but no mixed requests have been
recorded, so the user should be prompted to refresh. |
| 14 var explanations = WebInspector.SecurityPanel._instance()._mainView.contentE
lement.getElementsByClassName("security-explanation"); |
| 15 for (var i = 0; i < explanations.length; i++) |
| 16 InspectorTest.dumpDeepInnerHTML(explanations[i]); |
| 17 |
| 18 // Now simulate a refresh. |
| 19 |
| 20 InspectorTest.mainTarget.model(WebInspector.SecurityModel).dispatchEventToLi
steners(WebInspector.SecurityModel.Events.SecurityStateChanged, new WebInspector
.PageSecurityState(SecurityAgent.SecurityState.Neutral, [], insecureContentStatu
s, true)); |
| 21 |
| 22 var passive = new WebInspector.NetworkRequest(InspectorTest.mainTarget, 0, "
http://foo.test", "https://foo.test", 0, 0, null); |
| 23 passive.mixedContentType = "optionally-blockable"; |
| 24 InspectorTest.dispatchRequestFinished(passive); |
| 25 |
| 26 var active = new WebInspector.NetworkRequest(InspectorTest.mainTarget, 0, "h
ttp://foo.test", "https://foo.test", 0, 0, null); |
| 27 active.mixedContentType = "blockable"; |
| 28 InspectorTest.dispatchRequestFinished(active); |
| 29 |
| 30 var explanations = WebInspector.SecurityPanel._instance()._mainView.contentE
lement.getElementsByClassName("security-explanation"); |
| 31 for (var i = 0; i < explanations.length; i++) |
| 32 InspectorTest.dumpDeepInnerHTML(explanations[i]); |
| 33 InspectorTest.completeTest(); |
| 34 } |
| 35 </script> |
| 36 </head> |
| 37 <body onload="runTest()"> |
| 38 <p>Tests that the active and pasive mixed content explanations prompt the user t
o refresh when there are no recorded requests, and link to the network panel whe
n there are recorded requests.</p> |
| 39 </body> |
| 40 </html> |
OLD | NEW |