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

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

Issue 267393003: DevTools: Load document (html) content from disk cache in page agent enabling. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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 | Annotate | Revision Log
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>
6
7 function nonFormattedFunction() { var i = 2 + 2; var a = 4; return a + i; }
8
9 function f1()
10 {
11 console.error("Test message.");
12 }
13
14 var test = function()
15 {
16 var panel = WebInspector.inspectorView.showPanel("sources");
17 var worker = new Worker("ScriptFormatterWorker.js");
18 var sourceFrame;
19 var scriptFormatter = InspectorTest.scriptFormatter();
20
21 InspectorTest.runDebuggerTestSuite([
22 function testConsoleMessagesForFormattedScripts(next)
23 {
24 InspectorTest.showScriptSource("script-formatter-console.html", didS howScriptSource);
25
26 function didShowScriptSource(frame)
27 {
28 sourceFrame = frame;
29 InspectorTest.evaluateInPage("f1()", didEvaluate);
30 }
31
32 function didEvaluate()
33 {
34 dumpConsoleMessageURLs();
35 InspectorTest.addResult("Pre-format row message list:");
36 InspectorTest.addResult(JSON.stringify(Object.keys(sourceFrame._ rowMessages)));
37 InspectorTest.addResult(JSON.stringify(Object.keys(sourceFrame._ messageBubbles)));
38 InspectorTest.addSniffer(WebInspector.ScriptFormatterEditorActio n.prototype, "_updateButton", uiSourceCodeScriptFormatted);
39 scriptFormatter._toggleFormatScriptSource();
40 }
41
42 function uiSourceCodeScriptFormatted()
43 {
44 dumpConsoleMessageURLs();
45 InspectorTest.addResult("Post-format row message list:");
46 var formattedSourceFrame = panel.visibleView;
47 InspectorTest.addResult(JSON.stringify(Object.keys(formattedSour ceFrame._rowMessages)));
48 InspectorTest.addResult(JSON.stringify(Object.keys(formattedSour ceFrame._messageBubbles)));
49 next();
50 }
51 }
52 ]);
53
54 function dumpConsoleMessageURLs()
55 {
56 WebInspector.inspectorView.panel("console");
57 var messages = WebInspector.ConsolePanel._view()._visibleViewMessages;
58 for (var i = 0; i < messages.length; ++i) {
59 var element = messages[i].toMessageElement();
60 var anchor = element.querySelector(".console-message-url");
61 InspectorTest.addResult(anchor.textContent);
62 }
63 }
64 }
65
66 </script>
67
68 </head>
69
70 <body onload="runTest()">
71 <p>Tests that the script formatting changes console line numbers.
72 </p>
73
74 </body>
75 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698