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

Unified Diff: LayoutTests/http/tests/inspector-protocol/request-mixed-content-status.html

Issue 1299493003: Attach mixed content status to resource requests when sent to devtools (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: change to MixedContentChecker::contextTypeForInspector() Created 5 years, 4 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
« no previous file with comments | « no previous file | LayoutTests/http/tests/inspector-protocol/request-mixed-content-status-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/http/tests/inspector-protocol/request-mixed-content-status.html
diff --git a/LayoutTests/http/tests/inspector-protocol/request-mixed-content-status.html b/LayoutTests/http/tests/inspector-protocol/request-mixed-content-status.html
new file mode 100644
index 0000000000000000000000000000000000000000..b90d4fbf26cdbfe87fe1981233e50be6288f3fec
--- /dev/null
+++ b/LayoutTests/http/tests/inspector-protocol/request-mixed-content-status.html
@@ -0,0 +1,79 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script type="text/javascript" src="../inspector-protocol/inspector-protocol-test.js"></script>
+<script src="/resources/get-host-info.js"></script>
+<script>
+if (window.testRunner) {
+ testRunner.overridePreference("WebKitAllowRunningInsecureContent", true);
+ testRunner.overridePreference("WebKitAllowDisplayingInsecureContent", true);
+}
+
+function noMixedContent()
+{
+ var iframe = document.createElement("iframe");
+ iframe.src = get_host_info().HTTPS_ORIGIN + "/inspector-protocol/resources/no-mixed-content-iframe.html";
+ document.body.appendChild(iframe);
+}
+
+function blockableMixedContent()
+{
+ var iframe = document.createElement("iframe");
+ iframe.src = get_host_info().HTTPS_ORIGIN + "/inspector-protocol/resources/active-mixed-content-iframe.html";
+ document.body.appendChild(iframe);
+}
+
+function optionallyBlockableMixedContent()
+{
+ var iframe = document.createElement("iframe");
+ iframe.src = get_host_info().HTTPS_ORIGIN + "/inspector-protocol/resources/passive-mixed-content-iframe.html";
+ document.body.appendChild(iframe);
+}
+
+function test()
+{
+ var expectedMixedContentType = "none";
+ InspectorTest.eventHandler["Network.requestWillBeSent"] = onRequestWillBeSent;
+ InspectorTest.sendCommand("Network.enable", {}, didEnableNetwork);
+
+ function didEnableNetwork(messageObject)
+ {
+ if (messageObject.error) {
+ InspectorTest.log("FAIL: Couldn't enable network agent" + messageObject.error.message);
+ InspectorTest.completeTest();
+ return;
+ }
+ InspectorTest.log("Network agent enabled");
+ InspectorTest.sendCommand("Runtime.evaluate", { "expression": "noMixedContent()" });
+ }
+
+ function onRequestWillBeSent(event) {
+ var req = event.params.request;
+ InspectorTest.log(req.url);
+ if (req.url.indexOf("check-mixed-content-status") === -1)
pfeldman 2015/08/19 17:10:19 You should dump into the log more aggressively, li
estark 2015/08/19 19:07:03 Done.
+ return;
+
+ if (req.mixedContentType !== expectedMixedContentType) {
+ InspectorTest.log("FAIL: expected mixed content " + expectedMixedContentType + ", got " + req.mixedContentStatus);
+ InspectorTest.completeTest();
+ return;
+ }
+
+ if (expectedMixedContentType == "none") {
+ expectedMixedContentType = "blockable";
+ InspectorTest.sendCommand("Runtime.evaluate", { "expression": "blockableMixedContent()" });
+ } else if (expectedMixedContentType == "blockable") {
pfeldman 2015/08/19 17:10:19 So this is a small state machine that iterates ove
estark 2015/08/19 19:07:03 Hmm, I wasn't quite able to get this to work, beca
+ expectedMixedContentType = "optionally-blockable";
+ InspectorTest.sendCommand("Runtime.evaluate", { "expression": "optionallyBlockableMixedContent()" });
+ } else if (expectedMixedContentType == "optionally-blockable") {
+ InspectorTest.completeTest();
+ }
+ }
+}
+
+</script>
+</head>
+<body onload="runTest()">
+ <p>Tests that willSendRequest contains the correct mixed content status.</p>
+</body>
+</html>
« no previous file with comments | « no previous file | LayoutTests/http/tests/inspector-protocol/request-mixed-content-status-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698