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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/inspector/network/request-name-path.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> 4 <script>
5 function test() 5 function test()
6 { 6 {
7 /** 7 /**
8 * @param {string} url 8 * @param {string} url
9 * @param {string=} targetUrl 9 * @param {string=} targetUrl
10 */ 10 */
11 function createNetworkRequestForURLAndDumpNameAndPath(url, targetUrl) 11 function createNetworkRequestForURLAndDumpNameAndPath(url, targetUrl)
12 { 12 {
13 var mainTarget = SDK.targetManager.mainTarget(); 13 var mainTarget = SDK.targetManager.mainTarget();
14 var currentTargetURL = mainTarget.inspectedURL(); 14 var currentTargetURL = mainTarget.inspectedURL();
15 if (targetUrl) 15 if (targetUrl)
16 mainTarget.setInspectedURL(targetUrl); 16 mainTarget.setInspectedURL(targetUrl);
17 InspectorTest.addResult("Dumping request name and path for url: " + url) ; 17 InspectorTest.addResult("Dumping request name and path for url: " + url) ;
18 var request = new SDK.NetworkRequest(InspectorTest.networkManager, 0, ur l); 18 var request = new SDK.NetworkRequest(InspectorTest.networkManager, Inspe ctorTest.NetworkAgent, 0, url);
19 InspectorTest.addResult(" name = " + request.name()); 19 InspectorTest.addResult(" name = " + request.name());
20 InspectorTest.addResult(" path = " + request.path()); 20 InspectorTest.addResult(" path = " + request.path());
21 InspectorTest.addResult(" targetUrl = " + (targetUrl ? targetUrl : cu rrentTargetURL)); 21 InspectorTest.addResult(" targetUrl = " + (targetUrl ? targetUrl : cu rrentTargetURL));
22 if (targetUrl !== currentTargetURL) 22 if (targetUrl !== currentTargetURL)
23 mainTarget.setInspectedURL(currentTargetURL); 23 mainTarget.setInspectedURL(currentTargetURL);
24 } 24 }
25 25
26 // Save the target URL to ensure test works well with other tests. 26 // Save the target URL to ensure test works well with other tests.
27 var mainTarget = SDK.targetManager.mainTarget(); 27 var mainTarget = SDK.targetManager.mainTarget();
28 var originalTargetURL = mainTarget.inspectedURL(); 28 var originalTargetURL = mainTarget.inspectedURL();
(...skipping 28 matching lines...) Expand all
57 InspectorTest.completeTest(); 57 InspectorTest.completeTest();
58 } 58 }
59 59
60 </script> 60 </script>
61 </head> 61 </head>
62 <body onload="runTest()"> 62 <body onload="runTest()">
63 <p>Tests name() and path() methods of NetworkRequest.</p> 63 <p>Tests name() and path() methods of NetworkRequest.</p>
64 <a href="https://bugs.webkit.org/show_bug.cgi?id=101064">Bug 101064</a> 64 <a href="https://bugs.webkit.org/show_bug.cgi?id=101064">Bug 101064</a>
65 </body> 65 </body>
66 </html> 66 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698