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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/inspector/security/mixed-content-active-and-passive-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
(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>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/inspector/security/mixed-content-active-and-passive-reload-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698