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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/inspector/security/mixed-content-reload.html

Issue 2354873003: DevTools security panel: prompt user to reload for mixed requests (Closed)
Patch Set: add a test that includes active mixed content 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 <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: true, displayedContentWithCertErrors: false, r anInsecureContentStyle: SecurityAgent.SecurityState.Insecure, displayedInsecureC ontentStyle: SecurityAgent.SecurityState.Neutral }; 9 var insecureContentStatus = { ranMixedContent: false, displayedMixedContent: true, ranContentWithCertErrors: false, displayedContentWithCertErrors: false, r anInsecureContentStyle: SecurityAgent.SecurityState.Insecure, displayedInsecureC ontentStyle: SecurityAgent.SecurityState.Neutral };
10 10
11 InspectorTest.mainTarget.model(WebInspector.SecurityModel).dispatchEventToLi steners(WebInspector.SecurityModel.Events.SecurityStateChanged, new WebInspector .PageSecurityState(SecurityAgent.SecurityState.Insecure, [], insecureContentStat us, true)); 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));
12 21
13 var request = new WebInspector.NetworkRequest(InspectorTest.mainTarget, 0, " http://foo.test", "https://foo.test", 0, 0, null); 22 var request = new WebInspector.NetworkRequest(InspectorTest.mainTarget, 0, " http://foo.test", "https://foo.test", 0, 0, null);
23 request.mixedContentType = "optionally-blockable";
14 InspectorTest.dispatchRequestFinished(request); 24 InspectorTest.dispatchRequestFinished(request);
15 25
16 var explanations = WebInspector.SecurityPanel._instance()._mainView.contentE lement.getElementsByClassName("security-explanation"); 26 var explanations = WebInspector.SecurityPanel._instance()._mainView.contentE lement.getElementsByClassName("security-explanation");
17 for (var i = 0; i < explanations.length; i++) 27 for (var i = 0; i < explanations.length; i++)
18 InspectorTest.dumpDeepInnerHTML(explanations[i]); 28 InspectorTest.dumpDeepInnerHTML(explanations[i]);
19 InspectorTest.completeTest(); 29 InspectorTest.completeTest();
20 } 30 }
21 </script> 31 </script>
22 </head> 32 </head>
23 <body onload="runTest()"> 33 <body onload="runTest()">
24 <p>Tests addition of explanation when an active subresource was loaded with cert ificate errors.</p> 34 <p>Tests that the mixed content explanation prompts the user to refresh when the re are no recorded requests, and links to the network panel when there are recor ded requests.</p>
25 </body> 35 </body>
26 </html> 36 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698