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

Unified 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, 2 months 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/http/tests/inspector/security/mixed-content-reload.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/security/active-subresource-with-cert-errors.html b/third_party/WebKit/LayoutTests/http/tests/inspector/security/mixed-content-reload.html
similarity index 52%
copy from third_party/WebKit/LayoutTests/http/tests/inspector/security/active-subresource-with-cert-errors.html
copy to third_party/WebKit/LayoutTests/http/tests/inspector/security/mixed-content-reload.html
index 99c3a597707a271be980582d6a7bb871ce80f269..6720bf2a673f6d0fbedcfd9c6c9a83b2f7272d72 100644
--- a/third_party/WebKit/LayoutTests/http/tests/inspector/security/active-subresource-with-cert-errors.html
+++ b/third_party/WebKit/LayoutTests/http/tests/inspector/security/mixed-content-reload.html
@@ -6,11 +6,21 @@
function test()
{
/** @type {!SecurityAgent.InsecureContentStatus} */
- var insecureContentStatus = { ranMixedContent: false, displayedMixedContent: false, ranContentWithCertErrors: true, displayedContentWithCertErrors: false, ranInsecureContentStyle: SecurityAgent.SecurityState.Insecure, displayedInsecureContentStyle: SecurityAgent.SecurityState.Neutral };
+ var insecureContentStatus = { ranMixedContent: false, displayedMixedContent: true, ranContentWithCertErrors: false, displayedContentWithCertErrors: false, ranInsecureContentStyle: SecurityAgent.SecurityState.Insecure, displayedInsecureContentStyle: SecurityAgent.SecurityState.Neutral };
- InspectorTest.mainTarget.model(WebInspector.SecurityModel).dispatchEventToListeners(WebInspector.SecurityModel.Events.SecurityStateChanged, new WebInspector.PageSecurityState(SecurityAgent.SecurityState.Insecure, [], insecureContentStatus, true));
+ InspectorTest.mainTarget.model(WebInspector.SecurityModel).dispatchEventToListeners(WebInspector.SecurityModel.Events.SecurityStateChanged, new WebInspector.PageSecurityState(SecurityAgent.SecurityState.Neutral, [], insecureContentStatus, true));
+
+ // At this point, the page has mixed content but no mixed requests have been recorded, so the user should be prompted to refresh.
+ var explanations = WebInspector.SecurityPanel._instance()._mainView.contentElement.getElementsByClassName("security-explanation");
+ for (var i = 0; i < explanations.length; i++)
+ InspectorTest.dumpDeepInnerHTML(explanations[i]);
+
+ // Now simulate a refresh.
+
+ InspectorTest.mainTarget.model(WebInspector.SecurityModel).dispatchEventToListeners(WebInspector.SecurityModel.Events.SecurityStateChanged, new WebInspector.PageSecurityState(SecurityAgent.SecurityState.Neutral, [], insecureContentStatus, true));
var request = new WebInspector.NetworkRequest(InspectorTest.mainTarget, 0, "http://foo.test", "https://foo.test", 0, 0, null);
+ request.mixedContentType = "optionally-blockable";
InspectorTest.dispatchRequestFinished(request);
var explanations = WebInspector.SecurityPanel._instance()._mainView.contentElement.getElementsByClassName("security-explanation");
@@ -21,6 +31,6 @@ function test()
</script>
</head>
<body onload="runTest()">
-<p>Tests addition of explanation when an active subresource was loaded with certificate errors.</p>
+<p>Tests that the mixed content explanation prompts the user to refresh when there are no recorded requests, and links to the network panel when there are recorded requests.</p>
</body>
</html>

Powered by Google App Engine
This is Rietveld 408576698