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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/inspector/security/main-origin-assigned-despite-request-missing.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: false, ranContentWithCertErrors: false, displayedContentWithCertErrors: false, ranInsecureContentStyle: Protocol.Security.SecurityState.Insecure, displayedInse cureContentStyle: Protocol.Security.SecurityState.Neutral }; 9 var insecureContentStatus = { ranMixedContent: false, displayedMixedContent: false, ranContentWithCertErrors: false, displayedContentWithCertErrors: false, ranInsecureContentStyle: Protocol.Security.SecurityState.Insecure, displayedInse cureContentStyle: Protocol.Security.SecurityState.Neutral };
10 InspectorTest.mainTarget.model(Security.SecurityModel).dispatchEventToListen ers(Security.SecurityModel.Events.SecurityStateChanged, new Security.PageSecurit yState(Protocol.Security.SecurityState.Secure, true, [], insecureContentStatus, null)); 10 InspectorTest.mainTarget.model(Security.SecurityModel).dispatchEventToListen ers(Security.SecurityModel.Events.SecurityStateChanged, new Security.PageSecurit yState(Protocol.Security.SecurityState.Secure, true, [], insecureContentStatus, null));
11 11
12 const page_url = InspectorTest.resourceTreeModel.mainFrame.url; 12 const page_url = InspectorTest.resourceTreeModel.mainFrame.url;
13 const page_origin = Common.ParsedURL.extractOrigin(page_url); 13 const page_origin = Common.ParsedURL.extractOrigin(page_url);
14 InspectorTest.addResult("Page origin: " + page_origin); 14 InspectorTest.addResult("Page origin: " + page_origin);
15 // Fire a Main Frame Navigation event without firing a NetworkRequest first. 15 // Fire a Main Frame Navigation event without firing a NetworkRequest first.
16 InspectorTest.mainTarget.model(SDK.ResourceTreeModel).dispatchEventToListene rs(SDK.ResourceTreeModel.Events.MainFrameNavigated, InspectorTest.resourceTreeMo del.mainFrame); 16 InspectorTest.mainTarget.model(SDK.ResourceTreeModel).dispatchEventToListene rs(SDK.ResourceTreeModel.Events.MainFrameNavigated, InspectorTest.resourceTreeMo del.mainFrame);
17 // Validate that this set the MainOrigin in the sidebar 17 // Validate that this set the MainOrigin in the sidebar
18 const detectedMainOrigin = Security.SecurityPanel._instance()._sidebarTree._ mainOrigin; 18 const detectedMainOrigin = Security.SecurityPanel._instance()._sidebarTree._ mainOrigin;
19 InspectorTest.addResult("Detected main origin: " + detectedMainOrigin); 19 InspectorTest.addResult("Detected main origin: " + detectedMainOrigin);
20 20
21 // Send subdownload resource requests to other origins. 21 // Send subdownload resource requests to other origins.
22 const request1 = new SDK.NetworkRequest(InspectorTest.mainTarget, 0, "https: //foo.test/favicon.ico", page_url, 0, 0, null); 22 const request1 = new SDK.NetworkRequest(InspectorTest.networkManager, Inspec torTest.NetworkAgent, 0, "https://foo.test/favicon.ico", page_url, 0, 0, null);
23 InspectorTest.dispatchRequestFinished(request1); 23 InspectorTest.dispatchRequestFinished(request1);
24 const request2 = new SDK.NetworkRequest(InspectorTest.mainTarget, 0, "https: //bar.test/bar.css", page_url, 0, 0, null); 24 const request2 = new SDK.NetworkRequest(InspectorTest.networkManager, Inspec torTest.NetworkAgent, 0, "https://bar.test/bar.css", page_url, 0, 0, null);
25 InspectorTest.dispatchRequestFinished(request2); 25 InspectorTest.dispatchRequestFinished(request2);
26 26
27 // Send one request to the Same Origin as the original page to ensure it app ears in the group. 27 // Send one request to the Same Origin as the original page to ensure it app ears in the group.
28 const request3 = new SDK.NetworkRequest(InspectorTest.mainTarget, 0, detecte dMainOrigin + "/favicon.ico", page_url, 0, 0, null); 28 const request3 = new SDK.NetworkRequest(InspectorTest.networkManager, Inspec torTest.NetworkAgent, 0, detectedMainOrigin + "/favicon.ico", page_url, 0, 0, nu ll);
29 InspectorTest.dispatchRequestFinished(request3); 29 InspectorTest.dispatchRequestFinished(request3);
30 InspectorTest.dumpSecurityPanelSidebarOrigins(); 30 InspectorTest.dumpSecurityPanelSidebarOrigins();
31 InspectorTest.completeTest(); 31 InspectorTest.completeTest();
32 } 32 }
33 </script> 33 </script>
34 </head> 34 </head>
35 <body onload="runTest()"> 35 <body onload="runTest()">
36 <p>Tests that the Main Origin is assigned even if there is no matching Request.< /p> 36 <p>Tests that the Main Origin is assigned even if there is no matching Request.< /p>
37 </body> 37 </body>
38 </html> 38 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698