Changeset 79880 in webkit


Ignore:
Timestamp:
Feb 28, 2011 10:23:06 AM (13 years ago)
Author:
podivilov@chromium.org
Message:

2011-02-28 Pavel Podivilov <podivilov@chromium.org>

Reviewed by Pavel Feldman.

Web Inspector: add live edit test.
https://bugs.webkit.org/show_bug.cgi?id=55360

  • http/tests/inspector/debugger-test.js: (initialize_DebuggerTest):
  • inspector/debugger/debug-inlined-scripts.html:
  • inspector/debugger/live-edit-expected.txt: Added.
  • inspector/debugger/live-edit.html: Added.
  • inspector/debugger/resources/edit-me.js: Added.
  • platform/gtk/Skipped:
  • platform/mac/Skipped:
  • platform/qt/Skipped:
  • platform/win/Skipped:

2011-02-28 Pavel Podivilov <podivilov@chromium.org>

Reviewed by Pavel Feldman.

Web Inspector: add live edit test.
https://bugs.webkit.org/show_bug.cgi?id=55360

Test: inspector/debugger/live-edit.html

  • inspector/front-end/SourceFrame.js: (WebInspector.SourceFrame.prototype._doubleClick): (WebInspector.SourceFrame.prototype._didEditLine):
Location:
trunk
Files:
3 added
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r79879 r79880  
     12011-02-28  Pavel Podivilov  <podivilov@chromium.org>
     2
     3        Reviewed by Pavel Feldman.
     4
     5        Web Inspector: add live edit test.
     6        https://bugs.webkit.org/show_bug.cgi?id=55360
     7
     8        * http/tests/inspector/debugger-test.js:
     9        (initialize_DebuggerTest):
     10        * inspector/debugger/debug-inlined-scripts.html:
     11        * inspector/debugger/live-edit-expected.txt: Added.
     12        * inspector/debugger/live-edit.html: Added.
     13        * inspector/debugger/resources/edit-me.js: Added.
     14        * platform/gtk/Skipped:
     15        * platform/mac/Skipped:
     16        * platform/qt/Skipped:
     17        * platform/win/Skipped:
     18
    1192011-02-28  Pavel Feldman  <pfeldman@chromium.org>
    220
  • trunk/LayoutTests/http/tests/inspector/debugger-test.js

    r79555 r79880  
    125125        InspectorTest.addResult(s);
    126126    }
     127};
     128
     129InspectorTest.dumpSourceFrameContents = function(sourceFrame)
     130{
     131    InspectorTest.addResult("==Source frame contents start==");
     132    var textModel = sourceFrame._textModel;
     133    for (var i = 0; i < textModel.linesCount; ++i)
     134        InspectorTest.addResult(textModel.line(i));
     135    InspectorTest.addResult("==Source frame contents end==");
    127136};
    128137
     
    162171                callback(sourceFrame);
    163172            else
    164                 InspectorTest.addSniffer(sourceFrame._textModel, "setText", callback.bind(null, sourceFrame));
     173                sourceFrame.addEventListener(WebInspector.SourceFrame.Events.Loaded, callback.bind(null, sourceFrame));
    165174            return;
    166175        }
  • trunk/LayoutTests/inspector/debugger/debug-inlined-scripts.html

    r78808 r79880  
    4646    function step4(sourceFrame)
    4747    {
    48         dumpSourceFrameContents(sourceFrame);
     48        InspectorTest.dumpSourceFrameContents(sourceFrame);
    4949        InspectorTest.resumeExecution(InspectorTest.waitUntilPaused.bind(null, step5));
    5050    }
     
    6363    function step6(sourceFrame)
    6464    {
    65         dumpSourceFrameContents(sourceFrame);
     65        InspectorTest.dumpSourceFrameContents(sourceFrame);
    6666        InspectorTest.resumeExecution(InspectorTest.waitUntilPaused.bind(null, step7));
    6767    }
     
    7070    {
    7171        InspectorTest.resumeExecution(InspectorTest.waitUntilPaused.bind(null, step5));
    72     }
    73 
    74     function dumpSourceFrameContents(sourceFrame)
    75     {
    76         InspectorTest.addResult("==Source frame contents start==");
    77         var textModel = sourceFrame._textModel;
    78         for (var i = 0; i < textModel.linesCount; ++i)
    79             InspectorTest.addResult(textModel.line(i));
    80         InspectorTest.addResult("==Source frame contents end==");
    8172    }
    8273}
  • trunk/LayoutTests/platform/gtk/Skipped

    r79857 r79880  
    11851185http/tests/inspector/network/network-size.html
    11861186
     1187# https://bugs.webkit.org/show_bug.cgi?id=40300
     1188inspector/debugger/live-edit.html
     1189
    11871190# [GTK] r65681 broke a couple GTK+ a11y tests
    11881191# https://bugs.webkit.org/show_bug.cgi?id=44316
  • trunk/LayoutTests/platform/mac/Skipped

    r79527 r79880  
    236236inspector/debugger/dom-breakpoints.html
    237237
     238# https://bugs.webkit.org/show_bug.cgi?id=40300
     239inspector/debugger/live-edit.html
     240
    238241# Safari doesn't allow to customize outermost scrollbars.
    239242# https://bugs.webkit.org/show_bug.cgi?id=43960
  • trunk/LayoutTests/platform/qt/Skipped

    r79879 r79880  
    102102# https://bugs.webkit.org/show_bug.cgi?id=43332
    103103inspector/debugger/dom-breakpoints.html
     104
     105# https://bugs.webkit.org/show_bug.cgi?id=40300
     106inspector/debugger/live-edit.html
    104107
    105108# This port doesn't support v8 i18n extension.
  • trunk/LayoutTests/platform/win/Skipped

    r79865 r79880  
    10921092inspector/debugger/dom-breakpoints.html
    10931093
     1094# https://bugs.webkit.org/show_bug.cgi?id=40300
     1095inspector/debugger/live-edit.html
     1096
    10941097# <https://bugs.webkit.org/show_bug.cgi?id=44484>
    10951098svg/batik/paints/patternRegions-positioned-objects.svg
  • trunk/Source/WebCore/ChangeLog

    r79878 r79880  
     12011-02-28  Pavel Podivilov  <podivilov@chromium.org>
     2
     3        Reviewed by Pavel Feldman.
     4
     5        Web Inspector: add live edit test.
     6        https://bugs.webkit.org/show_bug.cgi?id=55360
     7
     8        Test: inspector/debugger/live-edit.html
     9
     10        * inspector/front-end/SourceFrame.js:
     11        (WebInspector.SourceFrame.prototype._doubleClick):
     12        (WebInspector.SourceFrame.prototype._didEditLine):
     13
    1142011-02-28  Pavel Feldman  <pfeldman@chromium.org>
    215
  • trunk/Source/WebCore/inspector/front-end/SourceFrame.js

    r79555 r79880  
    812812            return;  // Do not trigger editing from line numbers.
    813813
    814         var lineNumber = lineRow.lineNumber;
     814        this._textViewer.editLine(lineRow, this._didEditLine.bind(this, lineRow.lineNumber));
     815    },
     816
     817    _didEditLine: function(lineNumber, newContent)
     818    {
     819        var lines = [];
     820        var oldLines = this._content.text.split('\n');
     821        for (var i = 0; i < oldLines.length; ++i) {
     822            if (i === lineNumber)
     823                lines.push(newContent);
     824            else
     825                lines.push(oldLines[i]);
     826        }
    815827        var location = this._content.sourceFrameLineNumberToActualLocation(lineNumber);
    816         if (!location.sourceID)
    817             return;
    818 
    819         function didEditLine(newContent)
    820         {
    821             var lines = [];
    822             var oldLines = this._content.text.split('\n');
    823             for (var i = 0; i < oldLines.length; ++i) {
    824                 if (i === lineNumber)
    825                     lines.push(newContent);
    826                 else
    827                     lines.push(oldLines[i]);
    828             }
    829             WebInspector.debuggerModel.editScriptSource(location.sourceID, lines.join("\n"));
    830         }
    831         this._textViewer.editLine(lineRow, didEditLine.bind(this));
     828        WebInspector.debuggerModel.editScriptSource(location.sourceID, lines.join("\n"));
    832829    },
    833830
Note: See TracChangeset for help on using the changeset viewer.