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

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

Issue 2851913002: [DevTools] Do not expose agents on Target
Patch Set: storage and tests.js Created 3 years, 7 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 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 {!Protocol.Security.InsecureContentStatus} */ 8 /** @type {!Protocol.Security.InsecureContentStatus} */
9 var insecureContentStatus = { ranMixedContent: true, displayedMixedContent: true, ranContentWithCertErrors: false, displayedContentWithCertErrors: false, ra nInsecureContentStyle: Protocol.Security.SecurityState.Insecure, displayedInsecu reContentStyle: Protocol.Security.SecurityState.Neutral }; 9 var insecureContentStatus = { ranMixedContent: true, displayedMixedContent: true, ranContentWithCertErrors: false, displayedContentWithCertErrors: false, ra nInsecureContentStyle: Protocol.Security.SecurityState.Insecure, displayedInsecu reContentStyle: Protocol.Security.SecurityState.Neutral };
10 10
11 InspectorTest.mainTarget.model(Security.SecurityModel).dispatchEventToListen ers(Security.SecurityModel.Events.SecurityStateChanged, new Security.PageSecurit yState(Protocol.Security.SecurityState.Neutral, true, [], insecureContentStatus, null)); 11 InspectorTest.mainTarget.model(Security.SecurityModel).dispatchEventToListen ers(Security.SecurityModel.Events.SecurityStateChanged, new Security.PageSecurit yState(Protocol.Security.SecurityState.Neutral, true, [], insecureContentStatus, null));
12 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. 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 = Security.SecurityPanel._instance()._mainView.contentEleme nt.getElementsByClassName("security-explanation"); 14 var explanations = Security.SecurityPanel._instance()._mainView.contentEleme nt.getElementsByClassName("security-explanation");
15 for (var i = 0; i < explanations.length; i++) 15 for (var i = 0; i < explanations.length; i++)
16 InspectorTest.dumpDeepInnerHTML(explanations[i]); 16 InspectorTest.dumpDeepInnerHTML(explanations[i]);
17 17
18 // Now simulate a refresh. 18 // Now simulate a refresh.
19 19
20 InspectorTest.mainTarget.model(Security.SecurityModel).dispatchEventToListen ers(Security.SecurityModel.Events.SecurityStateChanged, new Security.PageSecurit yState(Protocol.Security.SecurityState.Neutral, true, [], insecureContentStatus, null)); 20 InspectorTest.mainTarget.model(Security.SecurityModel).dispatchEventToListen ers(Security.SecurityModel.Events.SecurityStateChanged, new Security.PageSecurit yState(Protocol.Security.SecurityState.Neutral, true, [], insecureContentStatus, null));
21 21
22 var passive = new SDK.NetworkRequest(InspectorTest.mainTarget, 0, "http://fo o.test", "https://foo.test", 0, 0, null); 22 var passive = new SDK.NetworkRequest(InspectorTest.networkManager, Inspector Test.NetworkAgent, 0, "http://foo.test", "https://foo.test", 0, 0, null);
23 passive.mixedContentType = "optionally-blockable"; 23 passive.mixedContentType = "optionally-blockable";
24 InspectorTest.dispatchRequestFinished(passive); 24 InspectorTest.dispatchRequestFinished(passive);
25 25
26 var active = new SDK.NetworkRequest(InspectorTest.mainTarget, 0, "http://foo .test", "https://foo.test", 0, 0, null); 26 var active = new SDK.NetworkRequest(InspectorTest.networkManager, InspectorT est.NetworkAgent, 0, "http://foo.test", "https://foo.test", 0, 0, null);
27 active.mixedContentType = "blockable"; 27 active.mixedContentType = "blockable";
28 InspectorTest.dispatchRequestFinished(active); 28 InspectorTest.dispatchRequestFinished(active);
29 29
30 var explanations = Security.SecurityPanel._instance()._mainView.contentEleme nt.getElementsByClassName("security-explanation"); 30 var explanations = Security.SecurityPanel._instance()._mainView.contentEleme nt.getElementsByClassName("security-explanation");
31 for (var i = 0; i < explanations.length; i++) 31 for (var i = 0; i < explanations.length; i++)
32 InspectorTest.dumpDeepInnerHTML(explanations[i]); 32 InspectorTest.dumpDeepInnerHTML(explanations[i]);
33 InspectorTest.completeTest(); 33 InspectorTest.completeTest();
34 } 34 }
35 </script> 35 </script>
36 </head> 36 </head>
37 <body onload="runTest()"> 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> 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> 39 </body>
40 </html> 40 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698