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

Changeset 99405 in webkit


Ignore:
Timestamp:
Nov 7, 2011, 4:19:57 AM (15 years ago)
Author:
pfeldman@chromium.org
Message:

Web Inspector: split script-formatter test into multiple tests.
https://bugs.webkit.org/show_bug.cgi?id=71607

Patch by Pavel Feldman <pfeldman@chromium.org> on 2011-11-07
Reviewed by Yury Semikhatsky.

Source/WebCore:

Tests: inspector/debugger/script-formatter-breakpoints.html

inspector/debugger/script-formatter-console.html

  • inspector/front-end/ScriptsPanel.js:

(WebInspector.ScriptsPanel.prototype._removeSourceFrame):

LayoutTests:

  • inspector/debugger/script-formatter-breakpoints-expected.txt: Added.
  • inspector/debugger/script-formatter-breakpoints.html: Added.
  • inspector/debugger/script-formatter-console-expected.txt: Added.
  • inspector/debugger/script-formatter-console.html: Added.
  • inspector/debugger/script-formatter-expected.txt:
  • inspector/debugger/script-formatter.html:
  • platform/mac/Skipped:
  • platform/qt/Skipped:
  • platform/win/Skipped:
Location:
trunk
Files:
4 added
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r99404 r99405  
     12011-11-07  Pavel Feldman  <pfeldman@chromium.org>
     2
     3        Web Inspector: split script-formatter test into multiple tests.
     4        https://bugs.webkit.org/show_bug.cgi?id=71607
     5
     6        Reviewed by Yury Semikhatsky.
     7
     8        * inspector/debugger/script-formatter-breakpoints-expected.txt: Added.
     9        * inspector/debugger/script-formatter-breakpoints.html: Added.
     10        * inspector/debugger/script-formatter-console-expected.txt: Added.
     11        * inspector/debugger/script-formatter-console.html: Added.
     12        * inspector/debugger/script-formatter-expected.txt:
     13        * inspector/debugger/script-formatter.html:
     14        * platform/mac/Skipped:
     15        * platform/qt/Skipped:
     16        * platform/win/Skipped:
     17
    1182011-11-07  Philippe Normand  <pnormand@igalia.com>
    219
  • trunk/LayoutTests/inspector/debugger/script-formatter-expected.txt

    r97060 r99405  
    1 CONSOLE MESSAGE: line 24: Test message.
    21Tests the script formatting functionality.
    32
     
    1615}
    1716</script></body></html>
    18 
    19 Running: testBreakpointsInOriginalAndFormattedSource
    20 Script execution paused.
    21 Script execution resumed.
    22 Page reloaded.
    23 Navigated to test-navigation.html
    24 Page reloaded.
    25 Navigated back to test page.
    26 Script execution paused.
    27 Script execution resumed.
    28 
    29 Running: testConsoleMessagesForFormattedScripts
    30 script-formatter.html:24
    31 script-formatter.html:32
    3217Debugger was disabled.
    3318
  • trunk/LayoutTests/inspector/debugger/script-formatter.html

    r97060 r99405  
    66
    77<script>
    8 
    9 function f1()
    10 {
    11     var a=0;var b=1;var c=3;var d=4;var e=5;
    12     var f=0;
    13     return 0;
    14 }
    15 
    16 function f2()
    17 {
    18     var x = 0;
    19     return 0;
    20 }
    21 
    22 function f3()
    23 {
    24     console.log("Test message.");
    25 }
    268
    279var test = function()
     
    10991            var content = "<html><body><script>function f(){}<" + "/script><script>function g(){}<" + "/script></body></html>";
    11092            worker.postMessage({ mimeType: "text/html", content: content });
    111         },
    112 
    113         function testBreakpointsInOriginalAndFormattedSource(next)
    114         {
    115             var root;
    116             InspectorTest.showScriptSource("script-formatter.html", didShowScriptSource);
    117 
    118             function didShowScriptSource(sourceFrame)
    119             {
    120                 root = sourceFrame._url.substr(0, sourceFrame._url.lastIndexOf("/") + 1);
    121                 InspectorTest.setBreakpoint(sourceFrame, 11, "", true);
    122                 InspectorTest.waitUntilPaused(pausedInF1);
    123                 InspectorTest.evaluateInPageWithTimeout("f1()");
    124             }
    125 
    126             function pausedInF1(callFrames)
    127             {
    128                 InspectorTest.assertEquals("f1", callFrames[0].functionName);
    129                 InspectorTest.resumeExecution(resumed);
    130             }
    131 
    132             function resumed()
    133             {
    134                 InspectorTest.navigate(root + "resources/test-navigation.html", didNavigateAnotherPage);
    135             }
    136 
    137             function didNavigateAnotherPage()
    138             {
    139                 InspectorTest.addResult("Navigated to test-navigation.html");
    140                 panel._toggleFormatSource();
    141                 InspectorTest.showScriptSource("test-navigation.html", didShowAnotherPage);
    142             }
    143 
    144             function didShowAnotherPage(sourceFrame)
    145             {
    146                 InspectorTest.navigate(root + "script-formatter.html", didNavigateBack);
    147             }
    148 
    149             function didNavigateBack()
    150             {
    151                 InspectorTest.addResult("Navigated back to test page.");
    152                 InspectorTest.showScriptSource("script-formatter.html", didShowFormattedScriptSource);
    153             }
    154 
    155             function didShowFormattedScriptSource(sourceFrame)
    156             {
    157                 // There should be no breakpoint in f1 since script is pretty-printed now.
    158                 InspectorTest.evaluateInPageWithTimeout("f1()");
    159                 InspectorTest.setBreakpoint(panel.visibleView, 24, "", true);
    160                 InspectorTest.waitUntilPaused(pausedInF2);
    161                 InspectorTest.evaluateInPageWithTimeout("f2()");
    162             }
    163 
    164             function pausedInF2(callFrames)
    165             {
    166                 InspectorTest.assertEquals("f2", callFrames[0].functionName);
    167                 panel._toggleFormatSource();
    168                 InspectorTest.resumeExecution(next);
    169             }
    170         },
    171 
    172         function testConsoleMessagesForFormattedScripts(next)
    173         {
    174             function dumpConsoleMessageURLs()
    175             {
    176                 var messages = WebInspector.console.messages;
    177                 for (var i = 0; i < messages.length; ++i) {
    178                     var element = messages[i].toMessageElement();
    179                     var anchor = element.querySelector(".console-message-url");
    180                     InspectorTest.addResult(anchor.textContent);
    181                 }
    182             }
    183             InspectorTest.evaluateInPage("f3()", didEvaluate);
    184 
    185             function didEvaluate()
    186             {
    187                 dumpConsoleMessageURLs();
    188                 InspectorTest.addSniffer(WebInspector, "formatLinkText", setTimeout.bind(window, didFormatLinkText, 0));
    189                 panel._toggleFormatSource();
    190             }
    191 
    192             function didFormatLinkText()
    193             {
    194                 dumpConsoleMessageURLs();
    195                 next();
    196             }
    19793        }
    19894    ]);
  • trunk/LayoutTests/platform/mac/Skipped

    r99339 r99405  
    487487fast/repaint/table-extra-bottom-grow.html
    488488
    489 # https://bugs.webkit.org/show_bug.cgi?id=71581
    490 inspector/debugger/script-formatter.html
  • trunk/LayoutTests/platform/qt/Skipped

    r99373 r99405  
    24332433fast/text/line-initial-and-final-swashes.html
    24342434
    2435 # [Qt] inspector/debugger/script-formatter.html failed after r97056
    2436 # https://bugs.webkit.org/show_bug.cgi?id=69757
    2437 inspector/debugger/script-formatter.html
    2438 
    24392435# [Qt] Assertion fail in CSSPrimitiveValue ctor
    24402436# https://bugs.webkit.org/show_bug.cgi?id=69933
  • trunk/LayoutTests/platform/win/Skipped

    r99339 r99405  
    14451445fast/events/platform-wheelevent-paging-y-in-scrolling-page.html
    14461446
    1447 # https://bugs.webkit.org/show_bug.cgi?id=71581
    1448 inspector/debugger/script-formatter.html
  • trunk/Source/WebCore/ChangeLog

    r99403 r99405  
     12011-11-07  Pavel Feldman  <pfeldman@chromium.org>
     2
     3        Web Inspector: split script-formatter test into multiple tests.
     4        https://bugs.webkit.org/show_bug.cgi?id=71607
     5
     6        Reviewed by Yury Semikhatsky.
     7
     8        Tests: inspector/debugger/script-formatter-breakpoints.html
     9               inspector/debugger/script-formatter-console.html
     10
     11        * inspector/front-end/ScriptsPanel.js:
     12        (WebInspector.ScriptsPanel.prototype._removeSourceFrame):
     13
    1142011-11-07  Keishi Hattori  <keishi@webkit.org>
    215
  • trunk/Source/WebCore/inspector/front-end/ScriptsPanel.js

    r98945 r99405  
    658658    {
    659659        var option = uiSourceCode._option;
    660         if (option)
     660        // FIXME: find out why we are getting here with option detached.
     661        if (option && this._filesSelectElement === option.parentElement)
    661662            this._filesSelectElement.removeChild(option);
    662663
Note: See TracChangeset for help on using the changeset viewer.