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

Unified Diff: third_party/WebKit/LayoutTests/inspector/file-system-project.html

Issue 2417083002: DevTools: introduce WI.UISourceCode.requestMetadata() (Closed)
Patch Set: normalize test + address nit 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/inspector/file-system-project.html
diff --git a/third_party/WebKit/LayoutTests/inspector/file-system-project.html b/third_party/WebKit/LayoutTests/inspector/file-system-project.html
index 1752459a16bd8d8c52e09234a80eed60e198c5fd..6f4dc625a30371ced66149c2120111f27f1c5980 100644
--- a/third_party/WebKit/LayoutTests/inspector/file-system-project.html
+++ b/third_party/WebKit/LayoutTests/inspector/file-system-project.html
@@ -221,6 +221,42 @@ function test()
next();
}
},
+
+ function testUISourceCodeMetadata(next)
+ {
+ var fs = new InspectorTest.TestFileSystem("file:///var/www3");
+ var file = fs.root.mkdir("test").addFile("hello.js", "123456");
+ fs.reportCreated(function() { });
+ InspectorTest.waitForScriptSource("hello.js", onUISourceCode);
+ var uiSourceCode;
+
+ function onUISourceCode(sourceCode)
+ {
+ uiSourceCode = sourceCode;
+ uiSourceCode.requestMetadata().then(onInitialMetadata);
+ }
+
+ function onInitialMetadata(metadata)
+ {
+ dumpMetadata("Initial metadata", metadata);
+ file.setContent("changed content");
+ uiSourceCode.requestMetadata().then(onChangedMetadata);
+ }
+
+ function onChangedMetadata(metadata)
+ {
+ dumpMetadata("Changed metadata", metadata);
+ fs.reportRemoved();
+ next();
+ }
+
+ function dumpMetadata(label, metadata)
+ {
+ InspectorTest.addResult(label);
+ InspectorTest.addResult(" content size: " + metadata.contentSize);
+ InspectorTest.addResult(" modification time: " + metadata.modificationTime.toISOString());
+ }
+ },
]);
};
</script>

Powered by Google App Engine
This is Rietveld 408576698