| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 | 3 |
| 4 <link rel="stylesheet" href="resources/test-mapping-bad.css"> | 4 <link rel="stylesheet" href="resources/test-mapping-bad.css"> |
| 5 | 5 |
| 6 <script src="../../http/tests/inspector/inspector-test.js"></script> | 6 <script src="../../http/tests/inspector/inspector-test.js"></script> |
| 7 <script src="../../http/tests/inspector/debugger-test.js"></script> | 7 <script src="../../http/tests/inspector/debugger-test.js"></script> |
| 8 <script src="./sass-test.js"></script> | 8 <script src="./sass-test.js"></script> |
| 9 <script> | 9 <script> |
| 10 | 10 |
| 11 function test() | 11 function test() |
| 12 { | 12 { |
| 13 var header = InspectorTest.cssModel.styleSheetHeaders().find(header => !!hea
der.sourceMapURL) | 13 var header = InspectorTest.cssModel.styleSheetHeaders().find(header => !!hea
der.sourceMapURL) |
| 14 InspectorTest.loadSourceMap(header, onSourceMapLoaded); | 14 InspectorTest.loadSourceMap(header, onSourceMapLoaded); |
| 15 InspectorTest.waitForScriptSource("test-mapping-bad.css", onCSSLoaded); | 15 InspectorTest.waitForScriptSource("test-mapping-bad.css", onCSSLoaded); |
| 16 InspectorTest.waitForScriptSource("test-mapping-bad.scss", onSCSSLoaded); | 16 InspectorTest.waitForScriptSource("test-mapping-bad.scss", onSCSSLoaded); |
| 17 | 17 |
| 18 var cssAST; | 18 var cssAST; |
| 19 var sassModels = new Map(); | 19 var sassModels = new Map(); |
| 20 var sourceMap; | 20 var sourceMap; |
| 21 | 21 |
| 22 function onCSSLoaded(uiSourceCode) | 22 function onCSSLoaded(uiSourceCode) |
| 23 { | 23 { |
| 24 uiSourceCode.requestContentPromise() | 24 uiSourceCode.requestContentPromise() |
| 25 .then(text => InspectorTest.parseCSS(uiSourceCode.originURL(), text)
) | 25 .then(text => InspectorTest.parseCSS(uiSourceCode.url(), text)) |
| 26 .then(ast => cssAST = ast) | 26 .then(ast => cssAST = ast) |
| 27 .then(maybeCreateMapping); | 27 .then(maybeCreateMapping); |
| 28 } | 28 } |
| 29 | 29 |
| 30 function onSCSSLoaded(uiSourceCode) | 30 function onSCSSLoaded(uiSourceCode) |
| 31 { | 31 { |
| 32 uiSourceCode.requestContentPromise() | 32 uiSourceCode.requestContentPromise() |
| 33 .then(text => InspectorTest.parseSCSS(uiSourceCode.originURL(), text
)) | 33 .then(text => InspectorTest.parseSCSS(uiSourceCode.url(), text)) |
| 34 .then(ast => sassModels.set(ast.document.url, ast)) | 34 .then(ast => sassModels.set(ast.document.url, ast)) |
| 35 .then(maybeCreateMapping); | 35 .then(maybeCreateMapping); |
| 36 } | 36 } |
| 37 | 37 |
| 38 function onSourceMapLoaded(sm) | 38 function onSourceMapLoaded(sm) |
| 39 { | 39 { |
| 40 sourceMap = sm; | 40 sourceMap = sm; |
| 41 maybeCreateMapping(); | 41 maybeCreateMapping(); |
| 42 } | 42 } |
| 43 | 43 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 54 } | 54 } |
| 55 | 55 |
| 56 </script> | 56 </script> |
| 57 | 57 |
| 58 </head> | 58 </head> |
| 59 | 59 |
| 60 <body onload="runTest()"> | 60 <body onload="runTest()"> |
| 61 <p>Verify that mapping is not valid for misaligned sources.</p> | 61 <p>Verify that mapping is not valid for misaligned sources.</p> |
| 62 </body> | 62 </body> |
| 63 </html> | 63 </html> |
| OLD | NEW |