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

Unified Diff: third_party/WebKit/LayoutTests/inspector/sources/debugger/live-edit-original-content.html

Issue 2695123004: DevTools: Only provide static script content to UISourceCode (Closed)
Patch Set: another try Created 3 years, 10 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/inspector/sources/debugger/live-edit-original-content-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/inspector/sources/debugger/live-edit-original-content.html
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger/live-edit-original-content.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger/live-edit-original-content.html
new file mode 100644
index 0000000000000000000000000000000000000000..761b6b4a2769e2e9994281fbc66a7838ea758a6b
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger/live-edit-original-content.html
@@ -0,0 +1,53 @@
+<html>
+<head>
+<script src="../../../http/tests/inspector/inspector-test.js"></script>
+<script src="../../../http/tests/inspector/debugger-test.js"></script>
+<script src="../../../http/tests/inspector/live-edit-test.js"></script>
+<script src="resources/edit-me.js"></script>
+
+<script>
+
+function test() {
+ InspectorTest.startDebuggerTest(testStarted);
+ function testStarted() {
+ InspectorTest.showScriptSource('edit-me.js', didShowScriptSource);
+ }
+
+ function didShowScriptSource(sourceFrame) {
+ replaceInSource(sourceFrame, 'return 0;', 'return "live-edited string";', didEditScriptSource);
+ }
+
+ function didEditScriptSource() {
+ UI.panels.sources.sourcesView().currentUISourceCode().requestOriginalContent().then(gotOriginalContent)
+ }
+
+ function gotOriginalContent(originalContent) {
+ InspectorTest.addResult('==== Original Content ====');
+ InspectorTest.addResult(originalContent);
+ UI.panels.sources.sourcesView().currentUISourceCode().requestContent().then(gotContent)
+ }
+
+ function gotContent(content) {
+ InspectorTest.addResult('');
+ InspectorTest.addResult('');
+ InspectorTest.addResult('==== Current Content ====');
+ InspectorTest.addResult(content);
+ InspectorTest.completeDebuggerTest();
+ }
+
+ function replaceInSource(sourceFrame, string, replacement, callback) {
+ InspectorTest.addSniffer(InspectorTest.debuggerModel, '_didEditScriptSource', callback);
+ InspectorTest.replaceInSource(sourceFrame, string, replacement);
+ InspectorTest.commitSource(sourceFrame);
+ }
+}
+
+</script>
+
+</head>
+
+<body onload="runTest()">
+<p>Tests that the original content is accessible on live edited scripts.</p>
+
+</body>
+</html>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/inspector/sources/debugger/live-edit-original-content-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698