Title: [101128] trunk
Revision
101128
Author
podivi...@chromium.org
Date
2011-11-24 01:10:20 -0800 (Thu, 24 Nov 2011)

Log Message

Web Inspector: add integration test for compiler source maps.
https://bugs.webkit.org/show_bug.cgi?id=72730

Reviewed by Pavel Feldman.

Source/WebCore:

Test: http/tests/inspector/compiler-source-mapping-debug.html

* inspector/front-end/DebuggerPresentationModel.js:
(WebInspector.DebuggerPresentationModel.prototype._bindScriptToRawSourceCode):
(WebInspector.DebuggerPresentationModel.prototype.setCompilerSourceMapping):
(WebInspector.DebuggerPresentationModel.prototype.evaluateInSelectedCallFrame):
(WebInspector.DebuggerPresentationModel.prototype.get executionLineLocation):
(WebInspector.DebuggerPresentationModel.DefaultLinkifierFormatter.prototype.formatRawSourceCodeAnchor):
(WebInspector.DebuggerPresentationModel.Linkifier.prototype.linkifyLocation):
(WebInspector.DebuggerPresentationModel.Linkifier.prototype._updateAnchor):

LayoutTests:

* http/tests/inspector/compiler-source-mapping-debug-expected.txt: Added.
* http/tests/inspector/compiler-source-mapping-debug.html: Added.
* http/tests/inspector/resources/source-map.json:
* http/tests/inspector/resources/source1.js:
* http/tests/inspector/resources/source2.js:
(ClickHandler.prototype.handle):

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (101127 => 101128)


--- trunk/LayoutTests/ChangeLog	2011-11-24 08:38:02 UTC (rev 101127)
+++ trunk/LayoutTests/ChangeLog	2011-11-24 09:10:20 UTC (rev 101128)
@@ -1,3 +1,17 @@
+2011-11-23  Pavel Podivilov  <podivi...@chromium.org>
+
+        Web Inspector: add integration test for compiler source maps.
+        https://bugs.webkit.org/show_bug.cgi?id=72730
+
+        Reviewed by Pavel Feldman.
+
+        * http/tests/inspector/compiler-source-mapping-debug-expected.txt: Added.
+        * http/tests/inspector/compiler-source-mapping-debug.html: Added.
+        * http/tests/inspector/resources/source-map.json:
+        * http/tests/inspector/resources/source1.js:
+        * http/tests/inspector/resources/source2.js:
+        (ClickHandler.prototype.handle):
+
 2011-11-24  Yury Semikhatsky  <yu...@chromium.org>
 
         Unreviewed. Update test expectations.

Added: trunk/LayoutTests/http/tests/inspector/compiler-source-mapping-debug-expected.txt (0 => 101128)


--- trunk/LayoutTests/http/tests/inspector/compiler-source-mapping-debug-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/http/tests/inspector/compiler-source-mapping-debug-expected.txt	2011-11-24 09:10:20 UTC (rev 101128)
@@ -0,0 +1,15 @@
+CONSOLE MESSAGE: line 2: button clicked!
+Tests installing compiler source map in scripts panel.
+
+
+Debugger was enabled.
+
+Running: testSetBreakpoint
+Script source was shown.
+Script execution paused.
+Call stack:
+    0) handleClick (compiled.js:2)
+    1) clickButton (compiler-source-mapping-debug.html:11)
+Script execution resumed.
+Debugger was disabled.
+
Property changes on: trunk/LayoutTests/http/tests/inspector/compiler-source-mapping-debug-expected.txt
___________________________________________________________________

Added: svn:eol-style

Added: trunk/LayoutTests/http/tests/inspector/compiler-source-mapping-debug.html (0 => 101128)


--- trunk/LayoutTests/http/tests/inspector/compiler-source-mapping-debug.html	                        (rev 0)
+++ trunk/LayoutTests/http/tests/inspector/compiler-source-mapping-debug.html	2011-11-24 09:10:20 UTC (rev 101128)
@@ -0,0 +1,53 @@
+<html>
+<head>
+<script src=""
+<script src=""
+<script src=""
+
+<script>
+
+function clickButton()
+{
+    document.getElementById('test').click();
+}
+
+function test()
+{
+
+    InspectorTest.runDebuggerTestSuite([
+        function testSetBreakpoint(next)
+        {
+            InspectorTest.showScriptSource("compiled.js", didShowCompiled);
+
+            function didShowCompiled(sourceFrame)
+            {
+                InspectorTest.addResult("Script source was shown.");
+                sourceFrame._model.setCompilerSourceMapping(sourceFrame._uiSourceCode, "http://localhost:8000/inspector/resources/source-map.json");
+                InspectorTest.showScriptSource("source1.js", didShowSource1);
+
+            }
+
+            function didShowSource1(sourceFrame)
+            {
+                InspectorTest.setBreakpoint(sourceFrame, 14, "", true);
+                InspectorTest.waitUntilPaused(paused);
+                InspectorTest.evaluateInPage("setTimeout(clickButton, 0)");
+            }
+
+            function paused(callFrames)
+            {
+                InspectorTest.captureStackTrace(callFrames);
+                next();
+            }
+        }
+    ]);
+};
+
+</script>
+
+</head>
+
+<body _onload_="runTest()">
+<p>Tests installing compiler source map in scripts panel.</p>
+</body>
+</html>
Property changes on: trunk/LayoutTests/http/tests/inspector/compiler-source-mapping-debug.html
___________________________________________________________________

Added: svn:eol-style

Added: trunk/LayoutTests/http/tests/inspector/compiler-source-mapping-expected.txt (0 => 101128)


--- trunk/LayoutTests/http/tests/inspector/compiler-source-mapping-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/http/tests/inspector/compiler-source-mapping-expected.txt	2011-11-24 09:10:20 UTC (rev 101128)
@@ -0,0 +1,11 @@
+Tests ClosureCompilerSourceMapping.
+
+
+Running: testSimpleMapping
+
+Running: testNoMappingEntry
+
+Running: testEmptyLine
+
+Running: testLoad
+
Property changes on: trunk/LayoutTests/http/tests/inspector/compiler-source-mapping-expected.txt
___________________________________________________________________

Added: svn:eol-style

Added: trunk/LayoutTests/http/tests/inspector/compiler-source-mapping.html (0 => 101128)


--- trunk/LayoutTests/http/tests/inspector/compiler-source-mapping.html	                        (rev 0)
+++ trunk/LayoutTests/http/tests/inspector/compiler-source-mapping.html	2011-11-24 09:10:20 UTC (rev 101128)
@@ -0,0 +1,121 @@
+<html>
+<head>
+<script src=""
+
+<script>
+
+function test()
+{
+    function checkMapping(compiledLineNumber, compiledColumnNumber, sourceURL, sourceLineNumber, sourceColumnNumber, mapping)
+    {
+        var sourceLocation = mapping.compiledLocationToSourceLocation(compiledLineNumber, compiledColumnNumber);
+        InspectorTest.assertEquals(sourceURL, sourceLocation.sourceURL);
+        InspectorTest.assertEquals(sourceLineNumber, sourceLocation.lineNumber);
+        InspectorTest.assertEquals(sourceColumnNumber, sourceLocation.columnNumber);
+    }
+
+    function checkReverseMapping(compiledLineNumber, compiledColumnNumber, sourceURL, sourceLineNumber, mapping)
+    {
+        var compiledLocation = mapping.sourceLocationToCompiledLocation(sourceURL, sourceLineNumber);
+        InspectorTest.assertEquals(compiledLineNumber, compiledLocation.lineNumber);
+        InspectorTest.assertEquals(compiledColumnNumber, compiledLocation.columnNumber);
+    }
+
+    InspectorTest.runTestSuite([
+        function testSimpleMapping(next)
+        {
+            /*
+                example.js:
+                0         1         2         3
+                012345678901234567890123456789012345
+                function add(variable_x, variable_y)
+                {
+                    return variable_x + variable_y;
+                }
+
+                var global = "foo";
+                ----------------------------------------
+                example-compiled.js:
+                0         1         2         3
+                012345678901234567890123456789012345
+                function add(a,b){return a+b}var global="foo";
+            */
+            var mappingPayload = {
+                "mappings":"AAASA,QAAAA,IAAG,CAACC,CAAD,CAAaC,CAAb,CACZ,CACI,MAAOD,EAAP,CAAoBC,CADxB,CAIA,IAAIC,OAAS;",
+                "sources":["example.js"]
+            };
+            var mapping = new WebInspector.ClosureCompilerSourceMapping();
+            mapping._parseMappingPayload(mappingPayload);
+
+            checkMapping(0, 9, "example.js", 0, 9, mapping);
+            checkMapping(0, 13, "example.js", 0, 13, mapping);
+            checkMapping(0, 15, "example.js", 0, 25, mapping);
+            checkMapping(0, 18, "example.js", 2, 4, mapping);
+            checkMapping(0, 25, "example.js", 2, 11, mapping);
+            checkMapping(0, 27, "example.js", 2, 24, mapping);
+
+            checkReverseMapping(0, 0, "example.js", 0, mapping);
+            checkReverseMapping(0, 17, "example.js", 1, mapping);
+            checkReverseMapping(0, 18, "example.js", 2, mapping);
+            checkReverseMapping(0, 29, "example.js", 4, mapping);
+            checkReverseMapping(0, 29, "example.js", 5, mapping);
+            InspectorTest.assertTrue(!mapping.sourceLocationToCompiledLocation("example.js", 6));
+
+            next();
+        },
+
+        function testNoMappingEntry(next)
+        {
+            var mappingPayload = {
+                "mappings":"AAAA,C,CAAE;",
+                "sources":["example.js"]
+            };
+            var mapping = new WebInspector.ClosureCompilerSourceMapping();
+            mapping._parseMappingPayload(mappingPayload);
+            checkMapping(0, 0, "example.js", 0, 0, mapping);
+            checkMapping(0, 2, "example.js", 0, 2, mapping);
+            next();
+        },
+
+        function testEmptyLine(next)
+        {
+            var mappingPayload = {
+                "mappings":"AAAA;;;CACA",
+                "sources":["example.js"]
+            };
+            var mapping = new WebInspector.ClosureCompilerSourceMapping();
+            mapping._parseMappingPayload(mappingPayload);
+            checkMapping(0, 0, "example.js", 0, 0, mapping);
+            checkReverseMapping(3, 1, "example.js", 1, mapping);
+            next();
+        },
+
+        function testLoad(next)
+        {
+            var sourceMapping = new WebInspector.ClosureCompilerSourceMapping("http://localhost:8000/inspector/resources/source-map.json");
+            var success = sourceMapping.load();
+            InspectorTest.assertTrue(success);
+
+            var sources = sourceMapping.sources();
+            InspectorTest.assertEquals(2, sources.length);
+            InspectorTest.assertEquals("source1.js", sources[0]);
+            InspectorTest.assertEquals("source2.js", sources[1]);
+
+            var sourceCode1 = sourceMapping.loadSourceCode(sourceMapping.sources()[0]);
+            InspectorTest.assertEquals(0, sourceCode1.indexOf("window.addEventListener"));
+
+            var sourceCode2 = sourceMapping.loadSourceCode(sourceMapping.sources()[1]);
+            InspectorTest.assertEquals(0, sourceCode2.indexOf("function ClickHandler()"));
+            next();
+        }
+    ]);
+};
+
+</script>
+
+</head>
+
+<body _onload_="runTest()">
+<p>Tests ClosureCompilerSourceMapping.</p>
+</body>
+</html>
Property changes on: trunk/LayoutTests/http/tests/inspector/compiler-source-mapping.html
___________________________________________________________________

Added: svn:eol-style

Added: trunk/LayoutTests/http/tests/inspector/resources/compiled.js (0 => 101128)


--- trunk/LayoutTests/http/tests/inspector/resources/compiled.js	                        (rev 0)
+++ trunk/LayoutTests/http/tests/inspector/resources/compiled.js	2011-11-24 09:10:20 UTC (rev 101128)
@@ -0,0 +1,2 @@
+window.addEventListener("load",function(){var a=document.createElement("button");a.id="test";a.addEventListener("click",handleClick,!0);document.body.appendChild(a);a=document.createElement("div");a.id="barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr";
+document.body.appendChild(a)});function handleClick(a){(new ClickHandler).handle(a)};function ClickHandler(){}ClickHandler.prototype.handle=function(){console.log("button clicked!")};
Property changes on: trunk/LayoutTests/http/tests/inspector/resources/compiled.js
___________________________________________________________________

Added: svn:eol-style

Modified: trunk/LayoutTests/http/tests/inspector/resources/source-map.json (101127 => 101128)


--- trunk/LayoutTests/http/tests/inspector/resources/source-map.json	2011-11-24 08:38:02 UTC (rev 101127)
+++ trunk/LayoutTests/http/tests/inspector/resources/source-map.json	2011-11-24 09:10:20 UTC (rev 101128)
@@ -1,7 +1,8 @@
 {
 "version":3,
+"file":"compiled.js",
 "lineCount":2,
-"mappings":"AACAA,MAAAC,OAAA,CAAwBC,QAAA,EACxB,CACI,IAAIC,EAAMC,QAAAC,cAAsB,CAAC,KAAD,CAChCF,EAAAG,YAAA,CAAkB,KAClBH,EAAAI,iBAAoB,CAAC,OAAD,CAAUC,WAAV,CAAuB,CAAA,CAAvB,CACpBJ,SAAAK,KAAAC,YAAyB,CAACP,CAAD,CAErBQ,EAAAA,CAAMP,QAAAC,cAAsB,CAAC,KAAD,CAChCM,EAAAL,YAAA,CAAkB,ocAClBF;QAAAK,KAAAC,YAAyB,CAACC,CAAD,CAR7B,CAWSH,SAAAA,YAAW,CAACI,CAAD,CACpB,CAEIC,CAD8BC,IAAZC,YAClBF,QAAc,CAACD,CAAD,CAFlB,CCbSG,QAAAA,aAAY,EACrB,EAGAA,YAAAC,UAAAH,OAAA,CAAwCI,QAAA,CAACL,CAAD,CACxC,CACI,IAAIM,EAAUd,QAAAC,cAAsB,CAAC,KAAD,CACpCa,EAAAZ,YAAA,CAAsBM,CAAAO,UACtBf,SAAAK,KAAAC,YAAyB,CAACQ,CAAD,CAH7B;",
+"mappings":"AACAA,MAAAC,iBAAuB,CAAC,MAAD,CAAS,QAAQ,EACxC,CACI,IAAIC,EAASC,QAAAC,cAAsB,CAAC,QAAD,CACnCF,EAAAG,GAAA,CAAY,MACZH,EAAAD,iBAAuB,CAAC,OAAD,CAAUK,WAAV,CAAuB,CAAA,CAAvB,CACvBH,SAAAI,KAAAC,YAAyB,CAACN,CAAD,CAErBO,EAAAA,CAAMN,QAAAC,cAAsB,CAAC,KAAD,CAChCK,EAAAJ,GAAA,CAAS,ocACTF;QAAAI,KAAAC,YAAyB,CAACC,CAAD,CAR7B,CADuB,CAYvBH,SAASA,YAAW,CAACI,CAAD,CACpB,CAEIC,CAD8BC,IAAZC,YAClBF,QAAc,CAACD,CAAD,CAFlB,C,CCbAG,QAASA,aAAY,EACrB,EAGAA,YAAAC,UAAAH,OAAA,CAAgCI,QAAQ,EACxC,CACIC,OAAAC,IAAW,CAAC,iBAAD,CADf;",
 "sources":["source1.js","source2.js"],
-"names":["window","onload","window.onload","foo","document","createElement","textContent","addEventListener","handleClick","body","appendChild","bar","event","handle","handler","ClickHandler","prototype","ClickHandler.prototype.handle","element","timeStamp"]
+"names":["window","addEventListener","button","document","createElement","id","handleClick","body","appendChild","bar","event","handle","handler","ClickHandler","prototype","ClickHandler.prototype.handle","console","log"]
 }

Modified: trunk/LayoutTests/http/tests/inspector/resources/source1.js (101127 => 101128)


--- trunk/LayoutTests/http/tests/inspector/resources/source1.js	2011-11-24 08:38:02 UTC (rev 101127)
+++ trunk/LayoutTests/http/tests/inspector/resources/source1.js	2011-11-24 09:10:20 UTC (rev 101128)
@@ -1,14 +1,14 @@
-window._onload_ = function()
+window.addEventListener('load', function()
 {
-    var foo = document.createElement('div');
-    foo.textContent = 'foo';
-    foo.addEventListener('click', handleClick, true);
-    document.body.appendChild(foo);
+    var button = document.createElement('button');
+    button.id = 'test';
+    button.addEventListener('click', handleClick, true);
+    document.body.appendChild(button);
 
     var bar = document.createElement('div');
-    bar.textContent = 'barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr';
+    bar.id = 'barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr';
     document.body.appendChild(bar);
-}
+});
 
 function handleClick(event)
 {

Modified: trunk/LayoutTests/http/tests/inspector/resources/source2.js (101127 => 101128)


--- trunk/LayoutTests/http/tests/inspector/resources/source2.js	2011-11-24 08:38:02 UTC (rev 101127)
+++ trunk/LayoutTests/http/tests/inspector/resources/source2.js	2011-11-24 09:10:20 UTC (rev 101128)
@@ -4,7 +4,5 @@
 
 ClickHandler.prototype.handle = function(event)
 {
-    var element = document.createElement('div');
-    element.textContent = event.timeStamp;
-    document.body.appendChild(element);
+    console.log('button clicked!');
 }

Modified: trunk/LayoutTests/platform/gtk/Skipped (101127 => 101128)


--- trunk/LayoutTests/platform/gtk/Skipped	2011-11-24 08:38:02 UTC (rev 101127)
+++ trunk/LayoutTests/platform/gtk/Skipped	2011-11-24 09:10:20 UTC (rev 101128)
@@ -1267,6 +1267,9 @@
 # https://bugs.webkit.org/show_bug.cgi?id=40300
 inspector/debugger/live-edit.html
 
+# https://bugs.webkit.org/show_bug.cgi?id=53003
+http/tests/inspector/compiler-source-mapping-debug.html
+
 # [GTK] r65681 broke a couple GTK+ a11y tests
 # https://bugs.webkit.org/show_bug.cgi?id=44316
 platform/gtk/accessibility/object-attributes.html

Modified: trunk/LayoutTests/platform/mac/Skipped (101127 => 101128)


--- trunk/LayoutTests/platform/mac/Skipped	2011-11-24 08:38:02 UTC (rev 101127)
+++ trunk/LayoutTests/platform/mac/Skipped	2011-11-24 09:10:20 UTC (rev 101128)
@@ -271,6 +271,9 @@
 # https://bugs.webkit.org/show_bug.cgi?id=40300
 inspector/debugger/live-edit.html
 
+# https://bugs.webkit.org/show_bug.cgi?id=53003
+http/tests/inspector/compiler-source-mapping-debug.html
+
 # Safari doesn't allow to customize outermost scrollbars.
 # https://bugs.webkit.org/show_bug.cgi?id=43960
 scrollbars/custom-scrollbar-with-incomplete-style.html

Modified: trunk/LayoutTests/platform/qt/Skipped (101127 => 101128)


--- trunk/LayoutTests/platform/qt/Skipped	2011-11-24 08:38:02 UTC (rev 101127)
+++ trunk/LayoutTests/platform/qt/Skipped	2011-11-24 09:10:20 UTC (rev 101128)
@@ -215,6 +215,9 @@
 # https://bugs.webkit.org/show_bug.cgi?id=40300
 inspector/debugger/live-edit.html
 
+# https://bugs.webkit.org/show_bug.cgi?id=53003
+http/tests/inspector/compiler-source-mapping-debug.html
+
 # Needs rebaseline
 fast/repaint/scale-page-shrink.html
 

Modified: trunk/LayoutTests/platform/win/Skipped (101127 => 101128)


--- trunk/LayoutTests/platform/win/Skipped	2011-11-24 08:38:02 UTC (rev 101127)
+++ trunk/LayoutTests/platform/win/Skipped	2011-11-24 09:10:20 UTC (rev 101128)
@@ -1198,6 +1198,9 @@
 # https://bugs.webkit.org/show_bug.cgi?id=40300
 inspector/debugger/live-edit.html
 
+# https://bugs.webkit.org/show_bug.cgi?id=53003
+http/tests/inspector/compiler-source-mapping-debug.html
+
 # <https://bugs.webkit.org/show_bug.cgi?id=44484>
 svg/batik/paints/patternRegions-positioned-objects.svg
 

Modified: trunk/LayoutTests/platform/wincairo/Skipped (101127 => 101128)


--- trunk/LayoutTests/platform/wincairo/Skipped	2011-11-24 08:38:02 UTC (rev 101127)
+++ trunk/LayoutTests/platform/wincairo/Skipped	2011-11-24 09:10:20 UTC (rev 101128)
@@ -1715,6 +1715,9 @@
 # https://bugs.webkit.org/show_bug.cgi?id=40300
 inspector/debugger/live-edit.html
 
+# https://bugs.webkit.org/show_bug.cgi?id=53003
+http/tests/inspector/compiler-source-mapping-debug.html
+
 # <https://bugs.webkit.org/show_bug.cgi?id=44484>
 svg/batik/paints/patternRegions-positioned-objects.svg
 

Modified: trunk/Source/WebCore/ChangeLog (101127 => 101128)


--- trunk/Source/WebCore/ChangeLog	2011-11-24 08:38:02 UTC (rev 101127)
+++ trunk/Source/WebCore/ChangeLog	2011-11-24 09:10:20 UTC (rev 101128)
@@ -1,3 +1,21 @@
+2011-11-23  Pavel Podivilov  <podivi...@chromium.org>
+
+        Web Inspector: add integration test for compiler source maps.
+        https://bugs.webkit.org/show_bug.cgi?id=72730
+
+        Reviewed by Pavel Feldman.
+
+        Test: http/tests/inspector/compiler-source-mapping-debug.html
+
+        * inspector/front-end/DebuggerPresentationModel.js:
+        (WebInspector.DebuggerPresentationModel.prototype._bindScriptToRawSourceCode):
+        (WebInspector.DebuggerPresentationModel.prototype.setCompilerSourceMapping):
+        (WebInspector.DebuggerPresentationModel.prototype.evaluateInSelectedCallFrame):
+        (WebInspector.DebuggerPresentationModel.prototype.get executionLineLocation):
+        (WebInspector.DebuggerPresentationModel.DefaultLinkifierFormatter.prototype.formatRawSourceCodeAnchor):
+        (WebInspector.DebuggerPresentationModel.Linkifier.prototype.linkifyLocation):
+        (WebInspector.DebuggerPresentationModel.Linkifier.prototype._updateAnchor):
+
 2011-11-23  Pavel Feldman  <pfeld...@google.com>
 
         Web Inspector: get rid of the WebInspector.mainResource, use WebInspector.inspectedPageURL instead.

Modified: trunk/Source/WebCore/inspector/front-end/DebuggerPresentationModel.js (101127 => 101128)


--- trunk/Source/WebCore/inspector/front-end/DebuggerPresentationModel.js	2011-11-24 08:38:02 UTC (rev 101127)
+++ trunk/Source/WebCore/inspector/front-end/DebuggerPresentationModel.js	2011-11-24 09:10:20 UTC (rev 101128)
@@ -157,7 +157,7 @@
     _bindScriptToRawSourceCode: function(script, rawSourceCode)
     {
         this._rawSourceCodeForScriptId[script.scriptId] = rawSourceCode;
-        this._rawSourceCodeForURL[script.sourceURL] = rawSourceCode; 
+        this._rawSourceCodeForURL[script.sourceURL] = rawSourceCode;
     },
 
     /**
@@ -336,6 +336,16 @@
     },
 
     /**
+     * @param {WebInspector.UISourceCode} uiSourceCode
+     * @param {string} sourceMappingURL
+     */
+    setCompilerSourceMapping: function(uiSourceCode, sourceMappingURL)
+    {
+        var sourceMapping = new WebInspector.ClosureCompilerSourceMapping(sourceMappingURL);
+        uiSourceCode.rawSourceCode.setCompilerSourceMapping(sourceMapping);
+    },
+
+    /**
      * @param {WebInspector.Event} event
      */
     _consoleMessageAdded: function(event)
@@ -551,11 +561,11 @@
                 callback(null, wasThrown, wasThrown ? null : result);
             else
                 callback(WebInspector.RemoteObject.fromPayload(result), wasThrown);
-            
+
             if (objectGroup === "console")
                 this.dispatchEventToListeners(WebInspector.DebuggerPresentationModel.Events.ConsoleCommandEvaluatedInSelectedCallFrame);
         }
-        
+
         this.selectedCallFrame.evaluate(code, objectGroup, includeCommandLineAPI, returnByValue, didEvaluate.bind(this));
     },
 
@@ -603,7 +613,7 @@
     {
         if (!this._selectedCallFrame.rawSourceCode.sourceMapping)
             return;
-        
+
         var rawLocation = this._selectedCallFrame._callFrame.location;
         var uiLocation = this._selectedCallFrame.rawSourceCode.sourceMapping.rawLocationToUILocation(rawLocation);
         return uiLocation;
@@ -910,7 +920,7 @@
         var uiLocation = rawSourceCode.sourceMapping.rawLocationToUILocation(anchor.rawLocation);
 
         anchor.textContent = WebInspector.formatLinkText(uiLocation.uiSourceCode.url, uiLocation.lineNumber);
-            
+
         var text = WebInspector.formatLinkText(uiLocation.uiSourceCode.url, uiLocation.lineNumber);
         if (this._maxLength)
             text = text.trimMiddle(this._maxLength);
@@ -944,7 +954,7 @@
         var rawSourceCode = this._model._rawSourceCodeForScriptWithURL(sourceURL);
         if (!rawSourceCode)
             return this.linkifyResource(sourceURL, lineNumber, classes);
-        
+
         return this.linkifyRawSourceCode(rawSourceCode, lineNumber, columnNumber, classes);
     },
 
@@ -1016,7 +1026,7 @@
         anchor.setAttribute("preferred_panel", "scripts");
         anchor.uiSourceCode = uiLocation.uiSourceCode;
         anchor.lineNumber = uiLocation.lineNumber;
-        
+
         this._formatter.formatRawSourceCodeAnchor(rawSourceCode, anchor);
     }
 }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to