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

Side by Side 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, 9 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <html>
2 <head>
3 <script src="../../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../../http/tests/inspector/debugger-test.js"></script>
5 <script src="../../../http/tests/inspector/live-edit-test.js"></script>
6 <script src="resources/edit-me.js"></script>
7
8 <script>
9
10 function test() {
11 InspectorTest.startDebuggerTest(testStarted);
12 function testStarted() {
13 InspectorTest.showScriptSource('edit-me.js', didShowScriptSource);
14 }
15
16 function didShowScriptSource(sourceFrame) {
17 replaceInSource(sourceFrame, 'return 0;', 'return "live-edited string";', di dEditScriptSource);
18 }
19
20 function didEditScriptSource() {
21 UI.panels.sources.sourcesView().currentUISourceCode().requestOriginalContent ().then(gotOriginalContent)
22 }
23
24 function gotOriginalContent(originalContent) {
25 InspectorTest.addResult('==== Original Content ====');
26 InspectorTest.addResult(originalContent);
27 UI.panels.sources.sourcesView().currentUISourceCode().requestContent().then( gotContent)
28 }
29
30 function gotContent(content) {
31 InspectorTest.addResult('');
32 InspectorTest.addResult('');
33 InspectorTest.addResult('==== Current Content ====');
34 InspectorTest.addResult(content);
35 InspectorTest.completeDebuggerTest();
36 }
37
38 function replaceInSource(sourceFrame, string, replacement, callback) {
39 InspectorTest.addSniffer(InspectorTest.debuggerModel, '_didEditScriptSource' , callback);
40 InspectorTest.replaceInSource(sourceFrame, string, replacement);
41 InspectorTest.commitSource(sourceFrame);
42 }
43 }
44
45 </script>
46
47 </head>
48
49 <body onload="runTest()">
50 <p>Tests that the original content is accessible on live edited scripts.</p>
51
52 </body>
53 </html>
OLDNEW
« 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