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> |