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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/inspector/network/request-name-path.html

Issue 2266473003: [Devtools] [Regression fix] Network Requests with data urls (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: [Devtools] [Regression fix] Network Requests with data urls Created 4 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 | third_party/WebKit/LayoutTests/http/tests/inspector/network/request-name-path-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/http/tests/inspector/network/request-name-path.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/network/request-name-path.html b/third_party/WebKit/LayoutTests/http/tests/inspector/network/request-name-path.html
index 51ec8b359732b874ff96feee79178fc395faacf0..cf35a3026fc9d69ebcfefb1db02110f2eedbfd99 100644
--- a/third_party/WebKit/LayoutTests/http/tests/inspector/network/request-name-path.html
+++ b/third_party/WebKit/LayoutTests/http/tests/inspector/network/request-name-path.html
@@ -4,14 +4,30 @@
<script>
function test()
{
- function createNetworkRequestForURLAndDumpNameAndPath(url)
+ /**
+ * @param {string} url
+ * @param {string=} targetUrl
+ */
+ function createNetworkRequestForURLAndDumpNameAndPath(url, targetUrl)
{
+ var mainTarget = WebInspector.targetManager.mainTarget();
+ var currentTargetURL = mainTarget.inspectedURL();
+ if (targetUrl)
+ mainTarget.setInspectedURL(targetUrl);
InspectorTest.addResult("Dumping request name and path for url: " + url);
- var request = new WebInspector.NetworkRequest(WebInspector.targetManager.mainTarget(), 0, url);
+ var request = new WebInspector.NetworkRequest(mainTarget, 0, url);
InspectorTest.addResult(" name = " + request.name());
InspectorTest.addResult(" path = " + request.path());
+ InspectorTest.addResult(" targetUrl = " + (targetUrl ? targetUrl : currentTargetURL));
+ if (targetUrl !== currentTargetURL)
+ mainTarget.setInspectedURL(currentTargetURL);
}
+ // Save the target URL to ensure test works well with other tests.
+ var mainTarget = WebInspector.targetManager.mainTarget();
+ var originalTargetURL = mainTarget.inspectedURL();
+ mainTarget.setInspectedURL("http://127.0.0.1/aFolder/aTest.html");
+
createNetworkRequestForURLAndDumpNameAndPath("http://www.example.com/foo/bar/baz?key=value");
createNetworkRequestForURLAndDumpNameAndPath("http://www.example.com/foo/bar/?key=value");
createNetworkRequestForURLAndDumpNameAndPath("http://www.example.com/foo/bar/baz");
@@ -31,6 +47,12 @@ function test()
createNetworkRequestForURLAndDumpNameAndPath("http://127.0.0.1/?key=value");
createNetworkRequestForURLAndDumpNameAndPath("http://127.0.0.1/baz");
createNetworkRequestForURLAndDumpNameAndPath("http://127.0.0.1/");
+ createNetworkRequestForURLAndDumpNameAndPath("http://127.0.0.1/", "data:text/html,<html><body><img src=\"data:,foobar\" /></body></html>");
+ createNetworkRequestForURLAndDumpNameAndPath("data:text/html,<html><body><img src=\"data:,foobar\" /></body></html>", "data:text/html,<html><body><img src=\"data:,foobar\" /></body></html>");
+ createNetworkRequestForURLAndDumpNameAndPath("data:text/html,<html><body><img src=\"data:,foobar\" /></body></html>", "http://127.0.0.1/");
+
+ // Restore the target URL to ensure test works well with other tests.
+ mainTarget.setInspectedURL(originalTargetURL);
InspectorTest.completeTest();
}
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/inspector/network/request-name-path-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698