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

Unified Diff: LayoutTests/inspector/load-file-resource-for-frontend.html

Issue 23102017: DevTools: fix source maps loading from file scheme urls. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed test Created 7 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
Index: LayoutTests/inspector/load-file-resource-for-frontend.html
diff --git a/LayoutTests/inspector/load-file-resource-for-frontend.html b/LayoutTests/inspector/load-file-resource-for-frontend.html
new file mode 100644
index 0000000000000000000000000000000000000000..dcd9b1a47b63cafb8769ab7e3514b2b9918ff873
--- /dev/null
+++ b/LayoutTests/inspector/load-file-resource-for-frontend.html
@@ -0,0 +1,38 @@
+<html>
+<head>
+<script src="../http/tests/inspector/inspector-test.js"></script>
+<script>
+function test()
+{
+ function testLoadForURL(url, next)
+ {
+ var documentURL = WebInspector.resourceTreeModel.mainFrame.url;
+ var lastIndexOfSlash = documentURL.lastIndexOf("/");
+ var urlPrefix = documentURL.substr(0, lastIndexOfSlash + 1);
+ var fullURL = urlPrefix + url;
+ InspectorTest.addResult("Loading resource from " + url);
+ NetworkAgent.loadResourceForFrontend(WebInspector.resourceTreeModel.mainFrame.id, fullURL, undefined, callback);
+
+ function callback(error, statusCode, headers, content)
+ {
+ if (error)
+ InspectorTest.addResult("Failed: " + error);
+ else {
+ InspectorTest.addResult("Content: " + content);
+ }
+ InspectorTest.runAfterPendingDispatches(next);
+ }
+ }
+
+ InspectorTest.runTestSuite([
+ function testResourceFromFileScheme(next)
+ {
+ testLoadForURL("resources/file-resource-to-load-for-frontend.txt", next);
+ },
+ ]);
+}
+</script>
+</head>
+<body onload="runTest()">
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698