OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 | 3 |
4 <link rel="stylesheet" href="resources/test-mapping-good.css"> | 4 <link rel="stylesheet" href="resources/test-mapping-good.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-good.css", onCSSLoaded); | 15 InspectorTest.waitForScriptSource("test-mapping-good.css", onCSSLoaded); |
16 InspectorTest.waitForScriptSource("test-mapping-good.scss", onSCSSLoaded); | 16 InspectorTest.waitForScriptSource("test-mapping-good.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 var mapping; | 21 var mapping; |
22 | 22 |
23 function onCSSLoaded(uiSourceCode) | 23 function onCSSLoaded(uiSourceCode) |
24 { | 24 { |
25 uiSourceCode.requestContentPromise() | 25 uiSourceCode.requestContent() |
26 .then(text => InspectorTest.parseCSS(uiSourceCode.url(), text)) | 26 .then(text => InspectorTest.parseCSS(uiSourceCode.url(), text)) |
27 .then(ast => cssAST = ast) | 27 .then(ast => cssAST = ast) |
28 .then(maybeCreateMapping); | 28 .then(maybeCreateMapping); |
29 } | 29 } |
30 | 30 |
31 function onSCSSLoaded(uiSourceCode) | 31 function onSCSSLoaded(uiSourceCode) |
32 { | 32 { |
33 uiSourceCode.requestContentPromise() | 33 uiSourceCode.requestContent() |
34 .then(text => InspectorTest.parseSCSS(uiSourceCode.url(), text)) | 34 .then(text => InspectorTest.parseSCSS(uiSourceCode.url(), text)) |
35 .then(ast => sassModels.set(ast.document.url, ast)) | 35 .then(ast => sassModels.set(ast.document.url, ast)) |
36 .then(maybeCreateMapping); | 36 .then(maybeCreateMapping); |
37 } | 37 } |
38 | 38 |
39 function onSourceMapLoaded(sm) | 39 function onSourceMapLoaded(sm) |
40 { | 40 { |
41 sourceMap = sm; | 41 sourceMap = sm; |
42 maybeCreateMapping(); | 42 maybeCreateMapping(); |
43 } | 43 } |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 } | 94 } |
95 | 95 |
96 </script> | 96 </script> |
97 | 97 |
98 </head> | 98 </head> |
99 | 99 |
100 <body onload="runTest()"> | 100 <body onload="runTest()"> |
101 <p>Verify CSSToSASSMapping rebaselines.</p> | 101 <p>Verify CSSToSASSMapping rebaselines.</p> |
102 </body> | 102 </body> |
103 </html> | 103 </html> |
OLD | NEW |