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

Side by Side Diff: third_party/WebKit/LayoutTests/inspector-enabled/sources/debugger/script-formatter-console.html

Issue 1609973002: DevTools: promisify ContentProvider.requestContent and all its clients. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebaseline Created 4 years, 11 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/console-test.js"></script> 4 <script src="../../../http/tests/inspector/console-test.js"></script>
5 <script src="../../../http/tests/inspector/debugger-test.js"></script> 5 <script src="../../../http/tests/inspector/debugger-test.js"></script>
6 <script> 6 <script>
7 7
8 function nonFormattedFunction() { var i = 2 + 2; var a = 4; return a + i; } 8 function nonFormattedFunction() { var i = 2 + 2; var a = 4; return a + i; }
9 9
10 function f1() 10 function f1()
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 { 44 {
45 sourceFrame = frame; 45 sourceFrame = frame;
46 InspectorTest.evaluateInPage("f1()", didEvaluate); 46 InspectorTest.evaluateInPage("f1()", didEvaluate);
47 } 47 }
48 48
49 function didEvaluate() 49 function didEvaluate()
50 { 50 {
51 dumpConsoleMessageURLs(); 51 dumpConsoleMessageURLs();
52 InspectorTest.addResult("Pre-format row message list:"); 52 InspectorTest.addResult("Pre-format row message list:");
53 InspectorTest.addResult(JSON.stringify(Object.keys(sourceFrame._ rowMessageBuckets))); 53 InspectorTest.addResult(JSON.stringify(Object.keys(sourceFrame._ rowMessageBuckets)));
54 InspectorTest.addSniffer(WebInspector.ScriptFormatterEditorActio n.prototype, "_updateButton", uiSourceCodeScriptFormatted); 54 formatVisibleSourceFrame(uiSourceCodeScriptFormatted);
pfeldman 2016/01/20 19:23:51 InspectorTest.showScriptSource
lushnikov 2016/01/20 23:35:58 Done.
55 scriptFormatter._toggleFormatScriptSource();
56 } 55 }
57 56
58 function uiSourceCodeScriptFormatted() 57 function uiSourceCodeScriptFormatted()
59 { 58 {
60 dumpConsoleMessageURLs(); 59 dumpConsoleMessageURLs();
61 InspectorTest.addResult("Post-format row message list:"); 60 InspectorTest.addResult("Post-format row message list:");
62 var formattedSourceFrame = panel.visibleView; 61 var formattedSourceFrame = panel.visibleView;
63 InspectorTest.addResult(JSON.stringify(Object.keys(formattedSour ceFrame._rowMessageBuckets))); 62 InspectorTest.addResult(JSON.stringify(Object.keys(formattedSour ceFrame._rowMessageBuckets)));
64 next(); 63 next();
65 } 64 }
66 } 65 }
67 ]); 66 ]);
68 67
68 function formatVisibleSourceFrame(callback)
69 {
70 InspectorTest.addSniffer(WebInspector.ScriptFormatterEditorAction.protot ype, "_updateButton", onSourceFormatted);
71 scriptFormatter._toggleFormatScriptSource();
72
73 function onSourceFormatted()
74 {
75 var formattedSourceFrame = panel.visibleView;
76 if (formattedSourceFrame.loaded) {
77 callback();
78 return;
79 }
80 InspectorTest.addSniffer(WebInspector.UISourceCodeFrame.prototype, " onTextEditorContentLoaded", callback);
81 }
82 }
83
69 function dumpConsoleMessageURLs() 84 function dumpConsoleMessageURLs()
70 { 85 {
71 var messages = WebInspector.ConsolePanel._view()._visibleViewMessages; 86 var messages = WebInspector.ConsolePanel._view()._visibleViewMessages;
72 for (var i = 0; i < messages.length; ++i) { 87 for (var i = 0; i < messages.length; ++i) {
73 var element = messages[i].toMessageElement(); 88 var element = messages[i].toMessageElement();
74 var anchor = element.querySelector(".console-message-url"); 89 var anchor = element.querySelector(".console-message-url");
75 InspectorTest.addResult(anchor.textContent); 90 InspectorTest.addResult(anchor.textContent);
76 } 91 }
77 } 92 }
78 } 93 }
79 94
80 </script> 95 </script>
81 96
82 </head> 97 </head>
83 98
84 <body onload="onload()"> 99 <body onload="onload()">
85 <p>Tests that the script formatting changes console line numbers. 100 <p>Tests that the script formatting changes console line numbers.
86 </p> 101 </p>
87 102
88 </body> 103 </body>
89 </html> 104 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698