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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/inspector/security/mixed-content-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: false, displayedMixedContent: true, ranContentWithCertErrors: false, displayedContentWithCertErrors: false, r anInsecureContentStyle: Protocol.Security.SecurityState.Insecure, displayedInsec ureContentStyle: Protocol.Security.SecurityState.Neutral }; 9 var insecureContentStatus = { ranMixedContent: false, displayedMixedContent: true, ranContentWithCertErrors: false, displayedContentWithCertErrors: false, r anInsecureContentStyle: Protocol.Security.SecurityState.Insecure, displayedInsec ureContentStyle: 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 request = new SDK.NetworkRequest(InspectorTest.mainTarget, 0, "http://fo o.test", "https://foo.test", 0, 0, null); 22 var request = new SDK.NetworkRequest(InspectorTest.networkManager, Inspector Test.NetworkAgent, 0, "http://foo.test", "https://foo.test", 0, 0, null);
23 request.mixedContentType = "optionally-blockable"; 23 request.mixedContentType = "optionally-blockable";
24 InspectorTest.dispatchRequestFinished(request); 24 InspectorTest.dispatchRequestFinished(request);
25 25
26 var explanations = Security.SecurityPanel._instance()._mainView.contentEleme nt.getElementsByClassName("security-explanation"); 26 var explanations = Security.SecurityPanel._instance()._mainView.contentEleme nt.getElementsByClassName("security-explanation");
27 for (var i = 0; i < explanations.length; i++) 27 for (var i = 0; i < explanations.length; i++)
28 InspectorTest.dumpDeepInnerHTML(explanations[i]); 28 InspectorTest.dumpDeepInnerHTML(explanations[i]);
29 InspectorTest.completeTest(); 29 InspectorTest.completeTest();
30 } 30 }
31 </script> 31 </script>
32 </head> 32 </head>
33 <body onload="runTest()"> 33 <body onload="runTest()">
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> 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>
35 </body> 35 </body>
36 </html> 36 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698