⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 101069 in webkit


Ignore:
Timestamp:
Nov 23, 2011, 5:10:27 AM (15 years ago)
Author:
podivilov@chromium.org
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):

Location:
trunk
Files:
2 added
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r101065 r101069  
     12011-11-18  Pavel Podivilov  <podivilov@chromium.org>
     2
     3        Web Inspector: add integration test for compiler source maps.
     4        https://bugs.webkit.org/show_bug.cgi?id=72730
     5
     6        Reviewed by Pavel Feldman.
     7
     8        * http/tests/inspector/compiler-source-mapping-debug-expected.txt: Added.
     9        * http/tests/inspector/compiler-source-mapping-debug.html: Added.
     10        * http/tests/inspector/resources/source-map.json:
     11        * http/tests/inspector/resources/source1.js:
     12        * http/tests/inspector/resources/source2.js:
     13        (ClickHandler.prototype.handle):
     14
    1152011-11-23  Scott Graham  <scottmg@chromium.org>
    216
  • trunk/LayoutTests/http/tests/inspector/resources/source-map.json

    r99823 r101069  
    11{
    22"version":3,
     3"file":"compiled.js",
    34"lineCount":2,
    4 "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;",
     5"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;",
    56"sources":["source1.js","source2.js"],
    6 "names":["window","onload","window.onload","foo","document","createElement","textContent","addEventListener","handleClick","body","appendChild","bar","event","handle","handler","ClickHandler","prototype","ClickHandler.prototype.handle","element","timeStamp"]
     7"names":["window","addEventListener","button","document","createElement","id","handleClick","body","appendChild","bar","event","handle","handler","ClickHandler","prototype","ClickHandler.prototype.handle","console","log"]
    78}
  • trunk/LayoutTests/http/tests/inspector/resources/source1.js

    r99823 r101069  
    1 window.onload = function()
     1window.addEventListener('load', function()
    22{
    3     var foo = document.createElement('div');
    4     foo.textContent = 'foo';
    5     foo.addEventListener('click', handleClick, true);
    6     document.body.appendChild(foo);
     3    var button = document.createElement('button');
     4    button.id = 'test';
     5    button.addEventListener('click', handleClick, true);
     6    document.body.appendChild(button);
    77
    88    var bar = document.createElement('div');
    9     bar.textContent = 'barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr';
     9    bar.id = 'barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr';
    1010    document.body.appendChild(bar);
    11 }
     11});
    1212
    1313function handleClick(event)
  • trunk/LayoutTests/http/tests/inspector/resources/source2.js

    r99823 r101069  
    55ClickHandler.prototype.handle = function(event)
    66{
    7     var element = document.createElement('div');
    8     element.textContent = event.timeStamp;
    9     document.body.appendChild(element);
     7    console.log('button clicked!');
    108}
  • trunk/LayoutTests/platform/gtk/Skipped

    r101060 r101069  
    12671267inspector/debugger/live-edit.html
    12681268
     1269# https://bugs.webkit.org/show_bug.cgi?id=53003
     1270http/tests/inspector/compiler-source-mapping-debug.html
     1271
    12691272# [GTK] r65681 broke a couple GTK+ a11y tests
    12701273# https://bugs.webkit.org/show_bug.cgi?id=44316
  • trunk/LayoutTests/platform/mac/Skipped

    r101025 r101069  
    272272inspector/debugger/live-edit.html
    273273
     274# https://bugs.webkit.org/show_bug.cgi?id=53003
     275http/tests/inspector/compiler-source-mapping-debug.html
     276
    274277# Safari doesn't allow to customize outermost scrollbars.
    275278# https://bugs.webkit.org/show_bug.cgi?id=43960
  • trunk/LayoutTests/platform/qt/Skipped

    r101043 r101069  
    215215# https://bugs.webkit.org/show_bug.cgi?id=40300
    216216inspector/debugger/live-edit.html
     217
     218# https://bugs.webkit.org/show_bug.cgi?id=53003
     219http/tests/inspector/compiler-source-mapping-debug.html
    217220
    218221# Needs rebaseline
  • trunk/LayoutTests/platform/win/Skipped

    r101025 r101069  
    11991199inspector/debugger/live-edit.html
    12001200
     1201# https://bugs.webkit.org/show_bug.cgi?id=53003
     1202http/tests/inspector/compiler-source-mapping-debug.html
     1203
    12011204# <https://bugs.webkit.org/show_bug.cgi?id=44484>
    12021205svg/batik/paints/patternRegions-positioned-objects.svg
  • trunk/LayoutTests/platform/wincairo/Skipped

    r101025 r101069  
    17161716inspector/debugger/live-edit.html
    17171717
     1718# https://bugs.webkit.org/show_bug.cgi?id=53003
     1719http/tests/inspector/compiler-source-mapping-debug.html
     1720
    17181721# <https://bugs.webkit.org/show_bug.cgi?id=44484>
    17191722svg/batik/paints/patternRegions-positioned-objects.svg
  • trunk/Source/WebCore/ChangeLog

    r101067 r101069  
     12011-11-18  Pavel Podivilov  <podivilov@chromium.org>
     2
     3        Web Inspector: add integration test for compiler source maps.
     4        https://bugs.webkit.org/show_bug.cgi?id=72730
     5
     6        Reviewed by Pavel Feldman.
     7
     8        Test: http/tests/inspector/compiler-source-mapping-debug.html
     9
     10        * inspector/front-end/DebuggerPresentationModel.js:
     11        (WebInspector.DebuggerPresentationModel.prototype._bindScriptToRawSourceCode):
     12        (WebInspector.DebuggerPresentationModel.prototype.setCompilerSourceMapping):
     13        (WebInspector.DebuggerPresentationModel.prototype.evaluateInSelectedCallFrame):
     14        (WebInspector.DebuggerPresentationModel.prototype.get executionLineLocation):
     15        (WebInspector.DebuggerPresentationModel.DefaultLinkifierFormatter.prototype.formatRawSourceCodeAnchor):
     16        (WebInspector.DebuggerPresentationModel.Linkifier.prototype.linkifyLocation):
     17        (WebInspector.DebuggerPresentationModel.Linkifier.prototype._updateAnchor):
     18
    1192011-11-23  Martin Robinson  <mrobinson@igalia.com>
    220
  • trunk/Source/WebCore/inspector/front-end/DebuggerPresentationModel.js

    r100906 r101069  
    158158    {
    159159        this._rawSourceCodeForScriptId[script.scriptId] = rawSourceCode;
    160         this._rawSourceCodeForURL[script.sourceURL] = rawSourceCode; 
     160        this._rawSourceCodeForURL[script.sourceURL] = rawSourceCode;
    161161    },
    162162
     
    337337
    338338    /**
     339     * @param {WebInspector.UISourceCode} uiSourceCode
     340     * @param {string} sourceMappingURL
     341     */
     342    setCompilerSourceMapping: function(uiSourceCode, sourceMappingURL)
     343    {
     344        var sourceMapping = new WebInspector.ClosureCompilerSourceMapping(sourceMappingURL);
     345        uiSourceCode.rawSourceCode.setCompilerSourceMapping(sourceMapping);
     346    },
     347
     348    /**
    339349     * @param {WebInspector.Event} event
    340350     */
     
    552562            else
    553563                callback(WebInspector.RemoteObject.fromPayload(result), wasThrown);
    554            
     564
    555565            if (objectGroup === "console")
    556566                this.dispatchEventToListeners(WebInspector.DebuggerPresentationModel.Events.ConsoleCommandEvaluatedInSelectedCallFrame);
    557567        }
    558        
     568
    559569        this.selectedCallFrame.evaluate(code, objectGroup, includeCommandLineAPI, returnByValue, didEvaluate.bind(this));
    560570    },
     
    604614        if (!this._selectedCallFrame.rawSourceCode.sourceMapping)
    605615            return;
    606        
     616
    607617        var rawLocation = this._selectedCallFrame._callFrame.location;
    608618        var uiLocation = this._selectedCallFrame.rawSourceCode.sourceMapping.rawLocationToUILocation(rawLocation);
     
    911921
    912922        anchor.textContent = WebInspector.formatLinkText(uiLocation.uiSourceCode.url, uiLocation.lineNumber);
    913            
     923
    914924        var text = WebInspector.formatLinkText(uiLocation.uiSourceCode.url, uiLocation.lineNumber);
    915925        if (this._maxLength)
     
    945955        if (!rawSourceCode)
    946956            return this.linkifyResource(sourceURL, lineNumber, classes);
    947        
     957
    948958        return this.linkifyRawSourceCode(rawSourceCode, lineNumber, columnNumber, classes);
    949959    },
     
    10171027        anchor.uiSourceCode = uiLocation.uiSourceCode;
    10181028        anchor.lineNumber = uiLocation.lineNumber;
    1019        
     1029
    10201030        this._formatter.formatRawSourceCodeAnchor(rawSourceCode, anchor);
    10211031    }
Note: See TracChangeset for help on using the changeset viewer.