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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/inspector/resource-tree/resource-metadata.html

Issue 2413233003: DevTools: introduce WI.Resource.contentSize() and WI.Resource.lastModified() (Closed)
Patch Set: always send last-modified in php script Created 4 years, 2 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: third_party/WebKit/LayoutTests/http/tests/inspector/resource-tree/resource-metadata.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/resource-tree/resource-metadata.html b/third_party/WebKit/LayoutTests/http/tests/inspector/resource-tree/resource-metadata.html
new file mode 100644
index 0000000000000000000000000000000000000000..acde4c74ce9a9ae40a08bd81b63d35be45b66094
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/inspector/resource-tree/resource-metadata.html
@@ -0,0 +1,41 @@
+<html>
+<head>
+<script src="../inspector-test.js"></script>
+<script src="../network-test.js"></script>
+<script>
+function addScript()
+{
+ var fulfill;
+ var promise = new Promise(x => fulfill = x);
+ var script = document.createElement("script");
+ script.type = "text/javascript";
+ script.src = "resources/script-with-constant-last-modified.php";
+ script.onload = fulfill;
+ document.body.appendChild(script);
+ return promise;
+}
+
+function test()
+{
+ InspectorTest.evaluateInPageAsync("addScript()").then(step2);
+
+ function step2()
+ {
+ var resource = InspectorTest.resourceTreeModel.resourceForURL("http://127.0.0.1:8000/inspector/resource-tree/resources/script-with-constant-last-modified.php");
+ if (!resource) {
+ InspectorTest.addResult("ERROR: Failed to find resource.");
+ InspectorTest.completeTest();
+ return;
+ }
+ InspectorTest.addResult("Last modified: " + (resource.lastModified() ? resource.lastModified().toISOString() : null));
+ InspectorTest.addResult("Content size: " + resource.contentSize());
+
+ InspectorTest.completeTest();
+ }
+}
+</script>
+</head>
+<body onload="runTest()">
+<p>Verify that dynamically added resource has metadata.</p>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698