Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / inspector-enabled / sources / debugger / script-formatter-console.html
blob1e46130dd320c3d4b4110fa7be4b5bc4d8d341a0
1 <html>
2 <head>
3 <script src="../../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../../http/tests/inspector/console-test.js"></script>
5 <script src="../../../http/tests/inspector/debugger-test.js"></script>
6 <script>
8 function nonFormattedFunction() { var i = 2 + 2; var a = 4; return a + i; }
10 function f1()
12 console.error("Test message.");
15 function onload()
17 if (window.testRunner) {
18 testRunner.waitUntilDone();
19 testRunner.showWebInspector();
21 runTest();
24 var test = function()
26 var panel = WebInspector.panels.sources;
27 var sourceFrame;
28 var scriptFormatter;
30 InspectorTest.runDebuggerTestSuite([
31 function testSetup(next)
33 InspectorTest.scriptFormatter().then(function(sf) {
34 scriptFormatter = sf;
35 next();
36 });
39 function testConsoleMessagesForFormattedScripts(next)
41 InspectorTest.showScriptSource("script-formatter-console.html", didShowScriptSource);
43 function didShowScriptSource(frame)
45 sourceFrame = frame;
46 InspectorTest.evaluateInPage("f1()", didEvaluate);
49 function didEvaluate()
51 dumpConsoleMessageURLs();
52 InspectorTest.addResult("Pre-format row message list:");
53 InspectorTest.addResult(JSON.stringify(Object.keys(sourceFrame._rowMessageBuckets)));
54 InspectorTest.addSniffer(WebInspector.ScriptFormatterEditorAction.prototype, "_updateButton", uiSourceCodeScriptFormatted);
55 scriptFormatter._toggleFormatScriptSource();
58 function uiSourceCodeScriptFormatted()
60 dumpConsoleMessageURLs();
61 InspectorTest.addResult("Post-format row message list:");
62 var formattedSourceFrame = panel.visibleView;
63 InspectorTest.addResult(JSON.stringify(Object.keys(formattedSourceFrame._rowMessageBuckets)));
64 next();
67 ]);
69 function dumpConsoleMessageURLs()
71 var messages = WebInspector.ConsolePanel._view()._visibleViewMessages;
72 for (var i = 0; i < messages.length; ++i) {
73 var element = messages[i].toMessageElement();
74 var anchor = element.querySelector(".console-message-url");
75 InspectorTest.addResult(anchor.textContent);
80 </script>
82 </head>
84 <body onload="onload()">
85 <p>Tests that the script formatting changes console line numbers.
86 </p>
88 </body>
89 </html>