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

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
« no previous file with comments | « LayoutTests/TestExpectations ('k') | LayoutTests/http/tests/inspector/compiler-script-mapping-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..71999c1f52c4c36e91de59cbd91b16f846750481 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();
},
@@ -280,7 +284,7 @@ function test()
InspectorTest.checkUILocation(originalUISourceCode, 1, 200, uiLocation(script, 1, 200));
InspectorTest.checkRawLocation(script, 0, 42, InspectorTest.testDebuggerWorkspaceBinding.uiLocationToRawLocation(target, uiSourceCode1, 3, 10));
- InspectorTest.checkRawLocation(script, 1, 85, InspectorTest.testDebuggerWorkspaceBinding.uiLocationToRawLocation(target, uiSourceCode2, 0, 0));
+ InspectorTest.checkRawLocation(script, 1, 85, InspectorTest.testDebuggerWorkspaceBinding.uiLocationToRawLocation(target, uiSourceCode2, 1, 0));
InspectorTest.checkRawLocation(script, 1, 110, InspectorTest.testDebuggerWorkspaceBinding.uiLocationToRawLocation(target, uiSourceCode2, 5, 2));
uiSourceCode1.requestContent(didRequestContent1);
@@ -345,7 +349,7 @@ function test()
InspectorTest.checkUILocation(originalUISourceCode, 1, 200, uiLocation(script, 1, 200));
InspectorTest.checkRawLocation(script, 0, 42, InspectorTest.testDebuggerWorkspaceBinding.uiLocationToRawLocation(target, uiSourceCode1, 3, 10));
- InspectorTest.checkRawLocation(script, 1, 85, InspectorTest.testDebuggerWorkspaceBinding.uiLocationToRawLocation(target, uiSourceCode2, 0, 0));
+ InspectorTest.checkRawLocation(script, 1, 85, InspectorTest.testDebuggerWorkspaceBinding.uiLocationToRawLocation(target, uiSourceCode2, 1, 0));
InspectorTest.checkRawLocation(script, 1, 110, InspectorTest.testDebuggerWorkspaceBinding.uiLocationToRawLocation(target, uiSourceCode2, 5, 2));
uiSourceCode1.requestContent(didRequestContent1);
« no previous file with comments | « LayoutTests/TestExpectations ('k') | LayoutTests/http/tests/inspector/compiler-script-mapping-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698