Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / inspector / sources / pretty-print-javascript-classes.html
blobfa9104b0cc9ea8551e306d758fafbbc2ffe07a80
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 src="../../http/tests/inspector/sources-test.js"></script>
6 <script src="debugger/resources/obfuscated.js"></script>
8 <script>
10 function test()
12 var testJSFormatter = InspectorTest.testPrettyPrint.bind(InspectorTest, "text/javascript");
14 InspectorTest.runTestSuite([
15 function emptyClass(next)
17 var mappingQueries = ["Test", "class"];
18 testJSFormatter("class Test{}", mappingQueries, next);
21 function emptyConstructor(next)
23 var mappingQueries = ["Test", "class", "constructor"];
24 testJSFormatter("class Test{constructor(){}}", mappingQueries, next);
27 function simpleClass(next)
29 var mappingQueries = ["Test", "class", "constructor"];
30 testJSFormatter("class Test{constructor(){this.bar=10;}givemebar(){return this.bar;}}", mappingQueries, next);
33 function extendedClass(next)
35 var mappingQueries = ["Foo", "Bar", "extends", "super", "name"];
36 testJSFormatter("class Foo extends Bar{constructor(name){super(name);}getName(){return super.getName();}}", mappingQueries, next);
39 function twoConsecutiveClasses(next)
41 var mappingQueries = ["B", "extends", "constructor", "super"];
42 testJSFormatter("class A{}class B extends A{constructor(){super();}}", mappingQueries, next);
45 function staticMethod(next)
47 var mappingQueries = ["Employer", "static", "1", "return"];
48 testJSFormatter("class Employer{static count(){this._counter = (this._counter || 0) + 1; return this._counter;}}", mappingQueries, next);
50 ]);
53 </script>
55 </head>
57 <body onload="runTest()">
58 <p>Verifies JavaScript pretty-printing functionality.</p>
59 </body>
60 </html>