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

Unified Diff: LayoutTests/http/tests/inspector/compiler-script-mapping.html

Issue 1328843002: DevTools: introduce WI.SourceMap.Entry structure and cleanup WI.SourceMap API. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fix test Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: LayoutTests/http/tests/inspector/compiler-script-mapping.html
diff --git a/LayoutTests/http/tests/inspector/compiler-script-mapping.html b/LayoutTests/http/tests/inspector/compiler-script-mapping.html
index 9dc06410dac482697f37b6b0d124958a359078dd..f9a3c0d0580a0061e9fa42a546ff6973b503f76f 100644
--- a/LayoutTests/http/tests/inspector/compiler-script-mapping.html
+++ b/LayoutTests/http/tests/inspector/compiler-script-mapping.html
@@ -21,16 +21,20 @@ function test()
function checkMapping(compiledLineNumber, compiledColumnNumber, sourceURL, sourceLineNumber, sourceColumnNumber, mapping)
{
var entry = mapping.findEntry(compiledLineNumber, compiledColumnNumber);
- InspectorTest.addResult(sourceURL + " === " + entry[2]);
- InspectorTest.addResult(sourceLineNumber + " === " + entry[3]);
- InspectorTest.addResult(sourceColumnNumber + " === " + entry[4]);
+ InspectorTest.addResult(sourceURL + " === " + entry.sourceURL);
+ InspectorTest.addResult(sourceLineNumber + " === " + entry.sourceLineNumber);
+ InspectorTest.addResult(sourceColumnNumber + " === " + entry.sourceColumnNumber);
}
function checkReverseMapping(compiledLineNumber, compiledColumnNumber, sourceURL, sourceLineNumber, mapping)
{
- var entry = mapping.findEntryReversed(sourceURL, sourceLineNumber, 5);
- InspectorTest.addResult(compiledLineNumber + " === " + entry[0]);
- InspectorTest.addResult(compiledColumnNumber + " === " + entry[1]);
+ var entry = mapping.firstSourceLineMapping(sourceURL, sourceLineNumber);
+ if (!entry) {
+ InspectorTest.addResult("source line " + sourceLineNumber + " has no mappings.");
+ return;
+ }
+ InspectorTest.addResult(compiledLineNumber + " === " + entry.lineNumber);
+ InspectorTest.addResult(compiledColumnNumber + " === " + entry.columnNumber);
}
function uiLocation(script, line, column)
@@ -111,7 +115,7 @@ function test()
var mapping = new WebInspector.SourceMap("source-map.json", mappingPayload);
checkMapping(0, 0, "example.js", 0, 0, mapping);
var entry = mapping.findEntry(0, 1);
- InspectorTest.assertEquals(2, entry.length);
+ InspectorTest.assertTrue(!entry.sourceURL);
checkMapping(0, 2, "example.js", 0, 2, mapping);
next();
},

Powered by Google App Engine
This is Rietveld 408576698