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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/inspector/text-source-map.html

Issue 2727383002: DevTools: sort sourceMap mappings since they might not be ordered. (Closed)
Patch Set: Created 3 years, 9 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/inspector/text-source-map-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <html> 1 <html>
2 <head> 2 <head>
3 <script src="inspector-test.js"></script> 3 <script src="inspector-test.js"></script>
4 <script src="debugger-test.js"></script> 4 <script src="debugger-test.js"></script>
5 5
6 <script> 6 <script>
7 7
8 function test() 8 function test()
9 { 9 {
10 function checkMapping(compiledLineNumber, compiledColumnNumber, sourceURL, s ourceLineNumber, sourceColumnNumber, mapping) 10 function checkMapping(compiledLineNumber, compiledColumnNumber, sourceURL, s ourceLineNumber, sourceColumnNumber, mapping)
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 checkReverseMapping(0, 18, "example.js", 2, mapping); 65 checkReverseMapping(0, 18, "example.js", 2, mapping);
66 checkReverseMapping(0, 29, "example.js", 4, mapping); 66 checkReverseMapping(0, 29, "example.js", 4, mapping);
67 checkReverseMapping(0, 29, "example.js", 5, mapping); 67 checkReverseMapping(0, 29, "example.js", 5, mapping);
68 68
69 next(); 69 next();
70 }, 70 },
71 71
72 function testNoMappingEntry(next) 72 function testNoMappingEntry(next)
73 { 73 {
74 var mappingPayload = { 74 var mappingPayload = {
75 "mappings":"AAAA,C,CAAE;", 75 "mappings": "AAAA,C,CAAE;",
76 "sources":["example.js"] 76 "sources": ["example.js"]
77 }; 77 };
78 var mapping = new SDK.TextSourceMap("compiled.js", "source-map.json" , mappingPayload); 78 var mapping = new SDK.TextSourceMap("compiled.js", "source-map.json" , mappingPayload);
79 checkMapping(0, 0, "example.js", 0, 0, mapping); 79 checkMapping(0, 0, "example.js", 0, 0, mapping);
80 var entry = mapping.findEntry(0, 1); 80 var entry = mapping.findEntry(0, 1);
81 InspectorTest.assertTrue(!entry.sourceURL); 81 InspectorTest.assertTrue(!entry.sourceURL);
82 checkMapping(0, 2, "example.js", 0, 2, mapping); 82 checkMapping(0, 2, "example.js", 0, 2, mapping);
83 next(); 83 next();
84 }, 84 },
85 85
86 function testEmptyLine(next) 86 function testEmptyLine(next)
87 { 87 {
88 var mappingPayload = { 88 var mappingPayload = {
89 "mappings":"AAAA;;;CACA", 89 "mappings":"AAAA;;;CACA",
90 "sources":["example.js"] 90 "sources":["example.js"]
91 }; 91 };
92 var mapping = new SDK.TextSourceMap("compiled.js", "source-map.json" , mappingPayload); 92 var mapping = new SDK.TextSourceMap("compiled.js", "source-map.json" , mappingPayload);
93 checkMapping(0, 0, "example.js", 0, 0, mapping); 93 checkMapping(0, 0, "example.js", 0, 0, mapping);
94 checkReverseMapping(3, 1, "example.js", 1, mapping); 94 checkReverseMapping(3, 1, "example.js", 1, mapping);
95 next(); 95 next();
96 }, 96 },
97 97
98 function testNonSortedMappings(next)
99 {
100 /*
101 example.js:
102 ABCD
103
104 compiled.js:
105 DCBA
106 */
107 var mappingPayload = {
108 // mappings go in reversed direction.
109 "mappings": "GAAA,DAAC,DAAC,DAAC",
110 "sources": ["example.js"]
111 };
112 var mapping = new SDK.TextSourceMap("compiled.js", "source-map.json" , mappingPayload);
113 checkMapping(0, 0, "example.js", 0, 3, mapping);
114 checkMapping(0, 1, "example.js", 0, 2, mapping);
115 checkMapping(0, 2, "example.js", 0, 1, mapping);
116 checkMapping(0, 3, "example.js", 0, 0, mapping);
117 next();
118 },
119
98 function testSections(next) 120 function testSections(next)
99 { 121 {
100 var mappingPayload = { 122 var mappingPayload = {
101 "sections": [{ 123 "sections": [{
102 "offset": { "line": 0, "column": 0 }, 124 "offset": { "line": 0, "column": 0 },
103 "map": { 125 "map": {
104 "mappings":"AAAA,CAEC", 126 "mappings":"AAAA,CAEC",
105 "sources":["source1.js", "source2.js"] 127 "sources":["source1.js", "source2.js"]
106 } 128 }
107 }, { 129 }, {
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 }; 232 };
211 233
212 </script> 234 </script>
213 235
214 </head> 236 </head>
215 237
216 <body onload="runTest()"> 238 <body onload="runTest()">
217 <p>Verify TextSourceMap implementation</p> 239 <p>Verify TextSourceMap implementation</p>
218 </body> 240 </body>
219 </html> 241 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/inspector/text-source-map-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698