Index: third_party/WebKit/LayoutTests/inspector/sass/test-mapping-bad.html |
diff --git a/third_party/WebKit/LayoutTests/inspector/sass/test-mapping-bad.html b/third_party/WebKit/LayoutTests/inspector/sass/test-mapping-bad.html |
index a7fc2ffd96c35437d94121b88e255559f00e24c3..9f45628d5e0b8e9258ad7b72ac067ff340f1c1c0 100644 |
--- a/third_party/WebKit/LayoutTests/inspector/sass/test-mapping-bad.html |
+++ b/third_party/WebKit/LayoutTests/inspector/sass/test-mapping-bad.html |
@@ -11,43 +11,14 @@ |
function test() |
{ |
var header = InspectorTest.cssModel.styleSheetHeaders().find(header => !!header.sourceMapURL) |
- InspectorTest.loadSourceMap(header, onSourceMapLoaded); |
- InspectorTest.waitForScriptSource("test-mapping-bad.css", onCSSLoaded); |
- InspectorTest.waitForScriptSource("test-mapping-bad.scss", onSCSSLoaded); |
+ InspectorTest.loadASTMapping(header, onMapping); |
- var cssAST; |
- var sassModels = new Map(); |
- var sourceMap; |
- |
- function onCSSLoaded(uiSourceCode) |
- { |
- uiSourceCode.requestContent() |
- .then(text => InspectorTest.parseCSS(uiSourceCode.url(), text)) |
- .then(ast => cssAST = ast) |
- .then(maybeCreateMapping); |
- } |
- |
- function onSCSSLoaded(uiSourceCode) |
- { |
- uiSourceCode.requestContent() |
- .then(text => InspectorTest.parseSCSS(uiSourceCode.url(), text)) |
- .then(ast => sassModels.set(ast.document.url, ast)) |
- .then(maybeCreateMapping); |
- } |
- |
- function onSourceMapLoaded(sm) |
- { |
- sourceMap = sm; |
- maybeCreateMapping(); |
- } |
- |
- function maybeCreateMapping() |
+ function onMapping(mapping) |
{ |
- if (!cssAST || !sassModels.size || !sourceMap) |
- return; |
- var mapping = WebInspector.SASSLiveSourceMap.CSSToSASSMapping.fromSourceMap(sourceMap, cssAST, sassModels); |
if (mapping.isValid()) { |
InspectorTest.addResult("ERROR: a valid mapping created for misaligned sourcemap."); |
+ } else { |
+ InspectorTest.addResult("OK: the mapping successfully reported misalignment."); |
} |
InspectorTest.completeTest(); |
} |