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

Side by Side Diff: third_party/WebKit/LayoutTests/inspector/console/console-link-to-snippet.html

Issue 2780933003: DevTools: support UISourceCode rename in automapping (Closed)
Patch Set: fix test Created 3 years, 8 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
OLDNEW
1 <html> 1 <html>
2 <head> 2 <head>
3 <script src="../../http/tests/inspector/inspector-test.js"></script> 3 <script src="../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../http/tests/inspector/sources-test.js"></script> 4 <script src="../../http/tests/inspector/sources-test.js"></script>
5 <script src="../../http/tests/inspector/console-test.js"></script> 5 <script src="../../http/tests/inspector/console-test.js"></script>
6 <script> 6 <script>
7 7
8 function test() 8 function test()
9 { 9 {
10 InspectorTest.addSniffer(Workspace.UISourceCode.prototype, "addLineMessage", dumpLineMessage, true); 10 InspectorTest.addSniffer(Workspace.UISourceCode.prototype, "addLineMessage", dumpLineMessage, true);
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 var callback; 55 var callback;
56 var promise = new Promise(fullfill => callback = fullfill); 56 var promise = new Promise(fullfill => callback = fullfill);
57 Snippets.scriptSnippetModel._project.createFile("", null, content, callb ack); 57 Snippets.scriptSnippetModel._project.createFile("", null, content, callb ack);
58 return promise; 58 return promise;
59 } 59 }
60 60
61 function renameSourceCodePromise(newName, uiSourceCode) 61 function renameSourceCodePromise(newName, uiSourceCode)
62 { 62 {
63 var callback; 63 var callback;
64 var promise = new Promise(fullfill => callback = fullfill); 64 var promise = new Promise(fullfill => callback = fullfill);
65 uiSourceCode.rename(newName, () => callback(uiSourceCode)); 65 uiSourceCode.rename(newName).then(() => callback(uiSourceCode));
66 return promise; 66 return promise;
67 } 67 }
68 68
69 function selectSourceCode(uiSourceCode) 69 function selectSourceCode(uiSourceCode)
70 { 70 {
71 return Common.Revealer.revealPromise(uiSourceCode).then(() => uiSourceCo de); 71 return Common.Revealer.revealPromise(uiSourceCode).then(() => uiSourceCo de);
72 } 72 }
73 73
74 function dumpLineMessage(level, text, lineNumber, columnNumber) 74 function dumpLineMessage(level, text, lineNumber, columnNumber)
75 { 75 {
76 InspectorTest.addResult(`Line Message was added: ${this.url()} ${level} '${text}':${lineNumber}:${columnNumber}`); 76 InspectorTest.addResult(`Line Message was added: ${this.url()} ${level} '${text}':${lineNumber}:${columnNumber}`);
77 } 77 }
78 78
79 function runSelectedSnippet() 79 function runSelectedSnippet()
80 { 80 {
81 Sources.SourcesPanel.instance()._runSnippet(); 81 Sources.SourcesPanel.instance()._runSnippet();
82 } 82 }
83 } 83 }
84 </script> 84 </script>
85 </head> 85 </head>
86 <body onload="runTest()"> 86 <body onload="runTest()">
87 <p>Test that link to snippet works.</p> 87 <p>Test that link to snippet works.</p>
88 </body> 88 </body>
89 </html> 89 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698