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

Unified Diff: third_party/WebKit/LayoutTests/inspector/sources/pretty-print-javascript-7.html

Issue 2103323006: DevTools: fix javascript pretty-printing of semicolon in some cases (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/inspector/sources/pretty-print-javascript-7-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/inspector/sources/pretty-print-javascript-7.html
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/pretty-print-javascript-7.html b/third_party/WebKit/LayoutTests/inspector/sources/pretty-print-javascript-7.html
new file mode 100644
index 0000000000000000000000000000000000000000..a2193555a8473d9d2d228ca13634d03c4613eb37
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/inspector/sources/pretty-print-javascript-7.html
@@ -0,0 +1,42 @@
+<html>
+<head>
+<script src="../../http/tests/inspector/inspector-test.js"></script>
+<script src="../../http/tests/inspector/debugger-test.js"></script>
+<script src="../../http/tests/inspector/sources-test.js"></script>
+<script src="debugger/resources/obfuscated.js"></script>
+
+<script>
+
+function test()
+{
+ var testJSFormatter = InspectorTest.testPrettyPrint.bind(InspectorTest, "text/javascript");
+
+ InspectorTest.runTestSuite([
+ function semicolonAfterFunctionExpression(next)
+ {
+ var mappingQueries = ["onClick", "function", "console", "log", "click!", "done"];
+ testJSFormatter("var onClick = function() { console.log('click!'); };console.log('done');", mappingQueries, next);
+ },
+
+ function semicolonAfterMultipleFunctionExpressions(next)
+ {
+ var mappingQueries = ["onStart", "onFinish", "a()", "b()"];
+ testJSFormatter("var onStart = function() { a(); }, onFinish = function() { b(); };", mappingQueries, next);
+ },
+
+ function semicolonAfterEmptyFunctionExpressions(next)
+ {
+ var mappingQueries = ["onStart", "delay", "1000", "belay", "activeElement"];
+ testJSFormatter("var onStart = function() {}, delay=1000, belay=document.activeElement;", mappingQueries, next);
+ },
+ ]);
+}
+
+</script>
+
+</head>
+
+<body onload="runTest()">
+<p>Verifies JavaScript pretty-printing functionality.</p>
+</body>
+</html>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/inspector/sources/pretty-print-javascript-7-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698