Changeset 89804 in webkit


Ignore:
Timestamp:
Jun 27, 2011 1:15:01 AM (13 years ago)
Author:
pfeldman@chromium.org
Message:

2011-06-26 Pavel Feldman <pfeldman@chromium.org>

Reviewed by Yury Semikhatsky.

Web Inspector: roll out r88337 for making tests flaky.
https://bugs.webkit.org/show_bug.cgi?id=63422

  • http/tests/inspector/elements-test.js: (initialize_ElementTest.InspectorTest.selectNodeWithId.onNodeFound): (initialize_ElementTest.InspectorTest.selectNodeWithId): (initialize_ElementTest.InspectorTest.waitForStyles): (initialize_ElementTest.InspectorTest.selectNodeAndWaitForStyles.nodeSelected): (initialize_ElementTest.InspectorTest.selectNodeAndWaitForStyles.stylesUpdated): (initialize_ElementTest.InspectorTest.selectNodeAndWaitForStyles):
  • http/tests/inspector/inspect-iframe-from-different-domain.html:
  • inspector/elements/edit-dom-actions.html:
  • inspector/elements/elements-delete-inline-style.html:
  • inspector/elements/elements-panel-styles.html:
  • inspector/styles/metrics-box-sizing.html:
  • inspector/styles/parse-utf8-bom.html:
  • inspector/styles/styles-add-blank-property.html:
  • inspector/styles/styles-add-invalid-property.html:
  • inspector/styles/styles-cancel-editing.html:
  • inspector/styles/styles-commit-editing.html:
  • inspector/styles/styles-computed-trace.html:
  • inspector/styles/styles-disable-inherited.html:
  • inspector/styles/styles-disable-then-change.html:
  • inspector/styles/styles-disable-then-delete.html:
  • inspector/styles/styles-disable-then-enable.html:
  • inspector/styles/styles-iframe-expected.txt:
  • inspector/styles/styles-iframe.html:
  • inspector/styles/styles-source-lines-expected.txt:
  • inspector/styles/styles-source-lines-inline.html:
  • inspector/styles/styles-source-lines.html:
  • inspector/styles/styles-update-from-js-expected.txt:
  • inspector/styles/styles-update-from-js.html:
  • inspector/styles/styles-url-linkify.html:
  • inspector/styles/up-down-numerics-and-colors-expected.txt:
  • inspector/styles/up-down-numerics-and-colors.html:

2011-06-26 Pavel Feldman <pfeldman@chromium.org>

Reviewed by Yury Semikhatsky.

Web Inspector: roll out r88337 for making tests flaky.
https://bugs.webkit.org/show_bug.cgi?id=63422

  • inspector/front-end/ElementsPanel.js: (WebInspector.ElementsPanel): (WebInspector.ElementsPanel.prototype.updateStyles): (WebInspector.ElementsPanel.prototype._stylesUpdated):
  • inspector/front-end/StylesSidebarPane.js: (WebInspector.StylesSidebarPane.prototype.update.stylesCallback): (WebInspector.StylesSidebarPane.prototype.update.computedStyleCallback): (WebInspector.StylesSidebarPane.prototype.update):
Location:
trunk
Files:
30 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r89799 r89804  
     12011-06-26  Pavel Feldman  <pfeldman@chromium.org>
     2
     3        Reviewed by Yury Semikhatsky.
     4
     5        Web Inspector: roll out r88337 for making tests flaky.
     6        https://bugs.webkit.org/show_bug.cgi?id=63422
     7
     8        * http/tests/inspector/elements-test.js:
     9        (initialize_ElementTest.InspectorTest.selectNodeWithId.onNodeFound):
     10        (initialize_ElementTest.InspectorTest.selectNodeWithId):
     11        (initialize_ElementTest.InspectorTest.waitForStyles):
     12        (initialize_ElementTest.InspectorTest.selectNodeAndWaitForStyles.nodeSelected):
     13        (initialize_ElementTest.InspectorTest.selectNodeAndWaitForStyles.stylesUpdated):
     14        (initialize_ElementTest.InspectorTest.selectNodeAndWaitForStyles):
     15        * http/tests/inspector/inspect-iframe-from-different-domain.html:
     16        * inspector/elements/edit-dom-actions.html:
     17        * inspector/elements/elements-delete-inline-style.html:
     18        * inspector/elements/elements-panel-styles.html:
     19        * inspector/styles/metrics-box-sizing.html:
     20        * inspector/styles/parse-utf8-bom.html:
     21        * inspector/styles/styles-add-blank-property.html:
     22        * inspector/styles/styles-add-invalid-property.html:
     23        * inspector/styles/styles-cancel-editing.html:
     24        * inspector/styles/styles-commit-editing.html:
     25        * inspector/styles/styles-computed-trace.html:
     26        * inspector/styles/styles-disable-inherited.html:
     27        * inspector/styles/styles-disable-then-change.html:
     28        * inspector/styles/styles-disable-then-delete.html:
     29        * inspector/styles/styles-disable-then-enable.html:
     30        * inspector/styles/styles-iframe-expected.txt:
     31        * inspector/styles/styles-iframe.html:
     32        * inspector/styles/styles-source-lines-expected.txt:
     33        * inspector/styles/styles-source-lines-inline.html:
     34        * inspector/styles/styles-source-lines.html:
     35        * inspector/styles/styles-update-from-js-expected.txt:
     36        * inspector/styles/styles-update-from-js.html:
     37        * inspector/styles/styles-url-linkify.html:
     38        * inspector/styles/up-down-numerics-and-colors-expected.txt:
     39        * inspector/styles/up-down-numerics-and-colors.html:
     40
    1412011-06-27  Csaba Osztrogonác  <ossy@webkit.org>
    242
  • trunk/LayoutTests/http/tests/inspector/elements-test.js

    r89347 r89804  
    6565InspectorTest.selectNodeWithId = function(idValue, callback)
    6666{
     67    callback = InspectorTest.safeWrap(callback);
    6768    function onNodeFound(node)
    6869    {
    69         InspectorTest.selectNode(node, callback);
     70        if (node)
     71            WebInspector.updateFocusedNode(node.id);
     72        callback(node);
    7073    }
    7174    InspectorTest.nodeWithId(idValue, onNodeFound);
    72 };
    73 
    74 InspectorTest.selectNode = function(node, callback)
    75 {
    76     callback = InspectorTest.safeWrap(callback);
    77     if (node)
    78         WebInspector.updateFocusedNode(node.id);
    79     InspectorTest.runAfterPendingDispatches(callback.bind(null, node));
     75}
     76
     77InspectorTest.waitForStyles = function(idValue, callback)
     78{
     79    callback = InspectorTest.safeWrap(callback);
     80
     81    (function sniff(node)
     82    {
     83        if (node && node.getAttribute("id") === idValue) {
     84            callback();
     85            return;
     86        }
     87        InspectorTest.addSniffer(WebInspector.ElementsPanel.prototype, "_stylesUpdated", sniff);
     88    })(null);
     89}
     90
     91InspectorTest.selectNodeAndWaitForStyles = function(idValue, callback)
     92{
     93    WebInspector.showPanel("elements");
     94
     95    callback = InspectorTest.safeWrap(callback);
     96
     97    var targetNode;
     98
     99    InspectorTest.waitForStyles(idValue, stylesUpdated);
     100    InspectorTest.selectNodeWithId(idValue, nodeSelected);
     101
     102    function nodeSelected(node)
     103    {
     104        targetNode = node;
     105    }
     106
     107    function stylesUpdated()
     108    {
     109        callback(targetNode);
     110    }
    80111}
    81112
  • trunk/LayoutTests/http/tests/inspector/inspect-iframe-from-different-domain.html

    r88337 r89804  
    1717function test()
    1818{
    19     InspectorTest.selectNodeWithId("iframe-body");
    20     InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", step1, true);
     19    InspectorTest.selectNodeAndWaitForStyles("iframe-body", step1);
    2120
    22     function step1(node)
     21    function step1()
    2322    {
    24         if (node && node.getAttribute("id") === "iframe-body") {
    25             var treeItem = InspectorTest.getElementStylePropertyTreeItem("background");
    26             InspectorTest.dumpStyleTreeItem(treeItem, "");
    27             InspectorTest.completeTest();
    28         }
     23        var treeItem = InspectorTest.getElementStylePropertyTreeItem("background");
     24        InspectorTest.dumpStyleTreeItem(treeItem, "");
     25        InspectorTest.completeTest();
    2926    }
    3027}
  • trunk/LayoutTests/inspector/elements/edit-dom-actions.html

    r88950 r89804  
    119119        InspectorTest.dumpElementsTree(testNode);
    120120
    121         InspectorTest.selectNodeWithId(dataNode, step1);
     121        InspectorTest.selectNodeWithId(dataNode, step0);
     122
     123        function step0(node)
     124        {
     125            InspectorTest.runAfterPendingDispatches(step1.bind(null, node));
     126        }
    122127
    123128        function step1(node)
  • trunk/LayoutTests/inspector/elements/elements-delete-inline-style.html

    r88337 r89804  
    88{
    99    WebInspector.showPanel("elements");
    10     InspectorTest.selectNodeWithId("inspected");
    11     InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", step1);
     10    InspectorTest.selectNodeAndWaitForStyles("inspected", step1);
    1211
    1312    function step1(node)
     
    1615        InspectorTest.dumpSelectedElementStyles(true);
    1716        node.removeAttribute("style");
    18         InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", step2);
     17        InspectorTest.waitForStyles("inspected", step2);
    1918    }
    2019
  • trunk/LayoutTests/inspector/elements/elements-panel-styles.html

    r88337 r89804  
    99function test()
    1010{
    11     InspectorTest.selectNodeWithId("foo");
    12     InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", step1, true);
     11    InspectorTest.selectNodeAndWaitForStyles("foo", step1);
    1312
    14     function step1(node)
     13    function step1()
    1514    {
    16         if (node && node.getAttribute("id") === "foo") {
    17             InspectorTest.dumpSelectedElementStyles(false, false);
    18             InspectorTest.completeTest();
    19         }
     15        InspectorTest.dumpSelectedElementStyles(false, false);
     16        InspectorTest.completeTest();
    2017    }
    2118}
  • trunk/LayoutTests/inspector/styles/metrics-box-sizing.html

    r84135 r89804  
    7373        function testBorderBoxInit1(next)
    7474        {
    75             InspectorTest.selectNodeWithId("border-box", next);
     75            InspectorTest.selectNodeAndWaitForStyles("border-box", next);
    7676        },
    7777
  • trunk/LayoutTests/inspector/styles/parse-utf8-bom.html

    r84777 r89804  
    99function test()
    1010{
    11     InspectorTest.selectNodeWithId("inspected", step1);
     11    InspectorTest.selectNodeAndWaitForStyles("inspected", step1);
    1212
    1313    function step1()
  • trunk/LayoutTests/inspector/styles/styles-add-blank-property.html

    r82252 r89804  
    88{
    99    WebInspector.showPanel("elements");
    10     InspectorTest.selectNodeWithId("inspected", step0);
     10    InspectorTest.selectNodeAndWaitForStyles("inspected", step1);
    1111
    1212    var treeElement;
    1313    var section;
    1414
    15     function step0()
     15    function step1()
    1616    {
    1717        InspectorTest.addResult("Before append:");
     
    1919        section = WebInspector.panels.elements.sidebarPanes.styles.sections[0][1];
    2020        section.expand();
    21         InspectorTest.runAfterPendingDispatches(step1);
    22     }
    2321
    24     function step1()
    25     {
    2622        // Create and increment.
    2723        treeElement = section.addNewBlankProperty();
     
    2925        treeElement.nameElement.textContent = "margin-left";
    3026        treeElement.nameElement.dispatchEvent(InspectorTest.createKeyEvent("Enter"));
     27
    3128        treeElement.valueElement.textContent = "1px";
    3229        treeElement.valueElement.firstChild.select();
     
    4643        // Commit.
    4744        treeElement.nameElement.dispatchEvent(InspectorTest.createKeyEvent("Enter"));
    48         InspectorTest.selectNodeWithId("other", step4);
     45        InspectorTest.selectNodeWithId("other");
     46        InspectorTest.runAfterPendingDispatches(step4);
    4947    }
    5048
    5149    function step4()
    5250    {
    53         InspectorTest.selectNodeWithId("inspected", step5);
     51        InspectorTest.selectNodeAndWaitForStyles("inspected", step5);
    5452    }
    5553
  • trunk/LayoutTests/inspector/styles/styles-add-invalid-property.html

    r88337 r89804  
    88{
    99    WebInspector.showPanel("elements");
    10     InspectorTest.selectNodeWithId("inspected");
    11     InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", step0);
     10    InspectorTest.selectNodeAndWaitForStyles("inspected", step1);
    1211
    1312    var treeElement;
    1413    var section;
    1514
    16     function step0()
     15    function step1()
    1716    {
    1817        InspectorTest.addResult("Before append:");
     
    2019        section = WebInspector.panels.elements.sidebarPanes.styles.sections[0][1];
    2120        section.expand();
    22         InspectorTest.runAfterPendingDispatches(step1);
    23     }
    2421
    25     function step1()
    26     {
    2722        // Create and increment.
    2823        treeElement = section.addNewBlankProperty();
     
    4742    function step3()
    4843    {
    49         InspectorTest.selectNodeWithId("other");
    50         InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", step4);
     44        InspectorTest.selectNodeAndWaitForStyles("other");
     45        InspectorTest.runAfterPendingDispatches(step4);
    5146    }
    5247
    5348    function step4()
    5449    {
    55         InspectorTest.selectNodeWithId("inspected");
    56         InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", step5);
     50        InspectorTest.selectNodeAndWaitForStyles("inspected", step5);
    5751    }
    5852
  • trunk/LayoutTests/inspector/styles/styles-cancel-editing.html

    r88337 r89804  
    88{
    99    WebInspector.showPanel("elements");
    10     InspectorTest.selectNodeWithId("inspected");
    11     InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", step1);
     10    InspectorTest.selectNodeAndWaitForStyles("inspected", step1);
    1211
    1312    var treeElement;
     
    3534    function step2()
    3635    {
    37         InspectorTest.selectNodeWithId("other");
    38         InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", step3);
     36        InspectorTest.selectNodeAndWaitForStyles("other", step3);
    3937    }
    4038
    4139    function step3()
    4240    {
    43         InspectorTest.selectNodeWithId("inspected");
    44         InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", step4);
     41        InspectorTest.selectNodeAndWaitForStyles("inspected", step4);
    4542    }
    4643
  • trunk/LayoutTests/inspector/styles/styles-commit-editing.html

    r88337 r89804  
    88{
    99    WebInspector.showPanel("elements");
    10     InspectorTest.selectNodeWithId("inspected");
    11     InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", step1);
     10    InspectorTest.selectNodeAndWaitForStyles("inspected", step1);
    1211
    1312    var treeElement;
     
    3635    function step2()
    3736    {
    38         InspectorTest.selectNodeWithId("other");
    39         InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", step3);
     37        InspectorTest.selectNodeAndWaitForStyles("other", step3);
    4038    }
    4139
    4240    function step3()
    4341    {
    44         InspectorTest.selectNodeWithId("inspected");
    45         InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", step4);
     42        InspectorTest.selectNodeAndWaitForStyles("inspected", step4);
    4643    }
    4744
  • trunk/LayoutTests/inspector/styles/styles-computed-trace.html

    r88337 r89804  
    3838function test()
    3939{
    40     InspectorTest.selectNodeWithId("id1");
    41     InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", step1);
     40    InspectorTest.selectNodeAndWaitForStyles("id1", step1);
    4241
    4342    function step1()
     
    4544        InspectorTest.addResult("==== Computed style for ID1 ====");
    4645        InspectorTest.dumpSelectedElementStyles(false, true);
    47 
    48         InspectorTest.selectNodeWithId("id2");
    49         InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", step2);
     46        InspectorTest.selectNodeAndWaitForStyles("id2", step2);
    5047    }
    5148
  • trunk/LayoutTests/inspector/styles/styles-disable-inherited.html

    r88337 r89804  
    88{
    99
    10     InspectorTest.selectNodeWithId("nested");
    11     InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", step1);
     10    InspectorTest.selectNodeAndWaitForStyles("nested", step1);
    1211
    1312    function step1()
     
    1716        InspectorTest.dumpSelectedElementStyles(true);
    1817
    19         InspectorTest.selectNodeWithId("container");
    20         InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", step2);
     18        InspectorTest.selectNodeAndWaitForStyles("container", step2);
    2119    }
    2220
     
    2523        var treeItem = InspectorTest.getElementStylePropertyTreeItem("font-weight");
    2624        treeItem.toggleEnabled({ target: { checked: false } });
    27         InspectorTest.selectNodeWithId("nested");
    28         InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", step3);
     25        InspectorTest.selectNodeAndWaitForStyles("nested", step3);
    2926    }
    3027
  • trunk/LayoutTests/inspector/styles/styles-disable-then-change.html

    r88441 r89804  
    77function test()
    88{
    9     InspectorTest.selectNodeWithId("container");
    10     InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", step1);
     9    InspectorTest.selectNodeAndWaitForStyles("container", step1);
    1110
    1211    function step1()
     
    1716        var treeItem = InspectorTest.getElementStylePropertyTreeItem("font-weight");
    1817        treeItem.toggleEnabled({ target: { checked: false } });
    19         InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", step2);
     18        InspectorTest.waitForStyles("container", step2);
    2019    }
    2120
     
    2726        var treeItem = InspectorTest.getElementStylePropertyTreeItem("font-weight");
    2827        treeItem.applyStyleText("color: green", true);
    29         InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", step3);
     28        InspectorTest.waitForStyles("container", step3);
    3029    }
    3130
  • trunk/LayoutTests/inspector/styles/styles-disable-then-delete.html

    r88337 r89804  
    77function test()
    88{
    9     InspectorTest.selectNodeWithId("container");
    10     InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", step1);
     9    InspectorTest.selectNodeAndWaitForStyles("container", step1);
    1110
    1211    function step1()
     
    3635    function step3()
    3736    {
    38         InspectorTest.selectNodeWithId("other");
    39         InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", step4);
     37        InspectorTest.selectNodeAndWaitForStyles("other", step4);
    4038    }
    4139
    4240    function step4()
    4341    {
    44         InspectorTest.selectNodeWithId("container");
    45         InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", step5);
     42        InspectorTest.selectNodeAndWaitForStyles("container", step5);
    4643    }
    4744
    48     function step5()
     45    function step5(node)
    4946    {
    5047        InspectorTest.addResult("After delete");
  • trunk/LayoutTests/inspector/styles/styles-disable-then-enable.html

    r88347 r89804  
    77function test()
    88{
    9     InspectorTest.selectNodeWithId("container");
    10     InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", step1);
     9    InspectorTest.selectNodeAndWaitForStyles("container", step1);
    1110
    12     function step1()
     11    function step1(node)
    1312    {
    1413        InspectorTest.addResult("Before disable");
     
    1716
    1817        treeItem.toggleEnabled({ target: { checked: false } });
    19         InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", step2);
     18        InspectorTest.waitForStyles("container", step2);
    2019    }
    2120
     
    2726
    2827        treeItem.toggleEnabled({ target: { checked: true } });
    29         InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", step3);
     28        InspectorTest.waitForStyles("container", step3);
    3029    }
    3130
  • trunk/LayoutTests/inspector/styles/styles-iframe-expected.txt

    r78535 r89804  
    77
    88======== Matched CSS Rules ========
    9 [expanded] body { (styles-iframe.html:5)
     9[expanded] #main { (styles-iframe.html:5)
    1010background: blue;
    1111
    12 [expanded] body { (user agent stylesheet)
     12[expanded] div { (user agent stylesheet)
    1313display: block;
    14 margin: 8px;
    1514
    1615
  • trunk/LayoutTests/inspector/styles/styles-iframe.html

    r88337 r89804  
    33
    44<style type="text/css" media="screen">
    5   body { background:blue; }
     5  #main { background:blue; }
    66</style>
    77
     
    2424    function step0()
    2525    {
    26         InspectorTest.selectNodeWithId("mainBody", step1);
     26        InspectorTest.selectNodeAndWaitForStyles("main", step1);
    2727    }
    2828
     
    3131        InspectorTest.addResult("Main frame style:");
    3232        InspectorTest.dumpSelectedElementStyles(true, false, true);
    33         InspectorTest.selectNodeWithId("iframeBody");
    34         InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", step2);
     33        InspectorTest.selectNodeAndWaitForStyles("iframeBody", step2);
    3534    }
    3635
     
    4544</head>
    4645
    47 <body onload="runTest()" id="mainBody">
     46<body onload="runTest()">
    4847<p>
    4948Tests that proper (and different) styles are returned for body elements of main document and iframe.
    5049</p>
    5150
     51<div id="main"></div>
    5252</body>
    5353</html>
  • trunk/LayoutTests/inspector/styles/styles-source-lines-expected.txt

    r78535 r89804  
    44
    55======== Matched CSS Rules ========
    6 [expanded] body, .at_line_50 { (styles-source-lines.html:50)
     6[expanded] #main, .at_line_50 { (styles-source-lines.html:50)
    77border: 1px solid
    88    red;
    99
    10 [expanded] body, .at_line_43 { (styles-source-lines.html:43)
     10[expanded] #main, .at_line_43 { (styles-source-lines.html:43)
    1111font-size: 10px;
    1212
    13 [expanded] body, .at_line_29 { (styles-source-lines.html:29)
     13[expanded] #main, .at_line_29 { (styles-source-lines.html:29)
    1414font-family: /*  Comment in
    1515                      value  */courier;
    1616
    17 [expanded] body, .at_line_15::before { (styles-source-lines.html:15)
     17[expanded] #main, .at_line_15::before { (styles-source-lines.html:15)
    1818color: red;
    1919content: "Before";
    2020
    21 [expanded] body { (user agent stylesheet)
     21[expanded] div { (user agent stylesheet)
    2222display: block;
    23 margin: 8px;
    2423
    2524
  • trunk/LayoutTests/inspector/styles/styles-source-lines-inline.html

    r88441 r89804  
    1414function test()
    1515{
    16     InspectorTest.selectNodeWithId("foo");
    17     InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", step1);
     16    InspectorTest.selectNodeAndWaitForStyles("foo", step2);
    1817
    19     function step1()
     18    function step2()
    2019    {
    2120        InspectorTest.dumpSelectedElementStyles(true, false, true);
  • trunk/LayoutTests/inspector/styles/styles-source-lines.html

    r82713 r89804  
    99
    1010<style type="text/css" media="screen">
    11 body, .at_line_15::/*
     11#main, .at_line_15::/*
    1212Multiline comment
    1313before pseudo element
     
    2424*/
    2525
    26 body, .at_line_29
     26#main, .at_line_29
    2727
    2828
     
    3838
    3939followed by selector
    40 */body,
     40*/#main,
    4141.at_line_43
    4242
     
    4747
    4848
    49 body, .at_line_50
     49#main, .at_line_50
    5050{
    5151    border: 1px solid
     
    6060function test()
    6161{
    62     InspectorTest.selectNodeWithId("mainBody", step1);
     62    InspectorTest.selectNodeAndWaitForStyles("main", step1);
    6363
    6464    function step1()
     
    7272</head>
    7373
    74 <body onload="runTest()" id="mainBody">
     74<body onload="runTest()">
    7575<p>
    7676Tests that proper source lines are reported for the parsed styles.
    7777</p>
    7878
     79<div id="main"></div>
     80
    7981</body>
    8082</html>
  • trunk/LayoutTests/inspector/styles/styles-update-from-js-expected.txt

    r88950 r89804  
    11Tests that changes to an inline style from JavaScript are reflected in the Styles pane and Elements tree.
    22
    3 Modified "style" attribute
     3
     4Running: testInit
     5
     6Running: testSetStyleAttribute
    47<div id="container" style="color: #daC0DE; border: 1px solid black;"></div>
    58[expanded] element.style { ()
     
    2023
    2124
    22 Modified cssText
     25
     26Running: testSetStyleCSSText
    2327<div id="container" style="color: rgb(192, 255, 238); "></div>
    2428[expanded] element.style { ()
     
    2630
    2731
    28 Modified parsed attributes
     32
     33Running: testSetViaParsedAttributes
    2934<div id="container" style="color: rgb(192, 255, 238); border-top-style: dashed; border-right-style: dashed; border-bottom-style: dashed; border-left-style: dashed; border-top-color: green; border-right-color: green; border-bottom-color: green; border-left-color: green; border-top-width: 3px; border-right-width: 3px; border-bottom-width: 3px; border-left-width: 3px; "></div>
    3035[expanded] element.style { ()
     
    4651
    4752
    48 Inline style invalidated 3 times
    4953
  • trunk/LayoutTests/inspector/styles/styles-update-from-js.html

    r88950 r89804  
    2323function test()
    2424{
    25     var sniffCount = 0;
    26     var inlineStyleInvalidationCount = 0;
     25    InspectorTest.runTestSuite([
     26        function testInit(next)
     27        {
     28            InspectorTest.selectNodeAndWaitForStyles("container", next);
     29        },
    2730
    28     InspectorTest.selectNodeWithId("container");
    29     InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", snifferCallback, true);
    30     InspectorTest.addSniffer(WebInspector.DOMDispatcher.prototype, "inlineStyleInvalidated", inlineStyleInvalidatedSniffer, true);
     31        function testSetStyleAttribute(next)
     32        {
     33            waitAndDumpAttributeAndStyles(next);
     34            InspectorTest.evaluateInPage("modifyStyleAttribute()");
     35        },
    3136
    32     function inlineStyleInvalidatedSniffer()
     37        function testSetStyleCSSText(next)
     38        {
     39            waitAndDumpAttributeAndStyles(next);
     40            InspectorTest.evaluateInPage("modifyCSSText()");
     41        },
     42
     43        function testSetViaParsedAttributes(next)
     44        {
     45            waitAndDumpAttributeAndStyles(next);
     46            InspectorTest.evaluateInPage("modifyParsedAttributes()");
     47        }
     48    ]);
     49
     50    function waitAndDumpAttributeAndStyles(next)
    3351    {
    34         inlineStyleInvalidationCount += 1;
    35     }
    36 
    37     function snifferCallback()
    38     {
    39         function innerCallback()
     52        function callback()
    4053        {
    41             switch (sniffCount++) {
    42                 case 0:
    43                     InspectorTest.evaluateInPage("modifyStyleAttribute()");
    44                     break;
    45                 case 1:
    46                     InspectorTest.addResult("Modified \"style\" attribute");
    47                     dumpAttributeAndStyles();
    48                     InspectorTest.evaluateInPage("modifyCSSText()");
    49                     break;
    50                 case 2:
    51                     InspectorTest.addResult("Modified cssText");
    52                     dumpAttributeAndStyles();
    53                     InspectorTest.evaluateInPage("modifyParsedAttributes()");
    54                     break;
    55                 case 3:
    56                     InspectorTest.addResult("Modified parsed attributes");
    57                     dumpAttributeAndStyles();
    58                     InspectorTest.addResult("Inline style invalidated " + inlineStyleInvalidationCount + " times");
    59                     InspectorTest.completeTest();
    60                     break;
    61             }
     54            dumpAttributeAndStyles();
     55            next();
    6256        }
    63 
    64         InspectorTest.runAfterPendingDispatches(innerCallback);
     57        InspectorTest.waitForStyles("container", callback);
    6558    }
    6659
  • trunk/LayoutTests/inspector/styles/styles-url-linkify.html

    r88920 r89804  
    5050    }
    5151
    52     InspectorTest.selectNodeWithId("local");
    53     InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", step1);
     52    InspectorTest.selectNodeAndWaitForStyles("local", step1);
    5453
    5554    function step1()
     
    5756        InspectorTest.addResult("Link for a URI from CSS document:");
    5857        dumpHref();
    59         InspectorTest.selectNodeWithId("iframed");
    60         InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", step2);
    61 
     58        InspectorTest.selectNodeAndWaitForStyles("iframed", step2);
    6259    }
    6360
  • trunk/LayoutTests/inspector/styles/up-down-numerics-and-colors-expected.txt

    r86663 r89804  
    44
    55
    6 Running: testInit1
    7 
    8 Running: testInit2
     6Running: testInit
    97
    108Running: testAlterColor
  • trunk/LayoutTests/inspector/styles/up-down-numerics-and-colors.html

    r88347 r89804  
    1919
    2020    InspectorTest.runTestSuite([
    21         function testInit1(next)
     21        function testInit(next)
    2222        {
    23             InspectorTest.selectNodeWithId("inspected");
    24             InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", next);
    25         },
     23            InspectorTest.selectNodeAndWaitForStyles("inspected", expandSection);
    2624
    27         function testInit2(next)
    28         {
    29             section = WebInspector.panels.elements.sidebarPanes.styles.sections[0][2];
    30             section.expand();
    31             InspectorTest.runAfterPendingDispatches(next);
     25            function expandSection()
     26            {
     27                section = WebInspector.panels.elements.sidebarPanes.styles.sections[0][2];
     28                section.expand();
     29                next();
     30            }
    3231        },
    3332
  • trunk/Source/WebCore/ChangeLog

    r89803 r89804  
     12011-06-26  Pavel Feldman  <pfeldman@chromium.org>
     2
     3        Reviewed by Yury Semikhatsky.
     4
     5        Web Inspector: roll out r88337 for making tests flaky.
     6        https://bugs.webkit.org/show_bug.cgi?id=63422
     7
     8        * inspector/front-end/ElementsPanel.js:
     9        (WebInspector.ElementsPanel):
     10        (WebInspector.ElementsPanel.prototype.updateStyles):
     11        (WebInspector.ElementsPanel.prototype._stylesUpdated):
     12        * inspector/front-end/StylesSidebarPane.js:
     13        (WebInspector.StylesSidebarPane.prototype.update.stylesCallback):
     14        (WebInspector.StylesSidebarPane.prototype.update.computedStyleCallback):
     15        (WebInspector.StylesSidebarPane.prototype.update):
     16
    1172011-06-27  Huang Dongsung  <luxtella@company100.net>
    218
  • trunk/Source/WebCore/inspector/front-end/ElementsPanel.js

    r88805 r89804  
    9898    this.sidebarElement.id = "elements-sidebar";
    9999
    100     for (var pane in this.sidebarPanes)
     100    for (var pane in this.sidebarPanes) {
    101101        this.sidebarElement.appendChild(this.sidebarPanes[pane].element);
     102        if (this.sidebarPanes[pane].onattach)
     103            this.sidebarPanes[pane].onattach();
     104    }
    102105
    103106    this.sidebarResizeElement = document.createElement("div");
     
    10161019            return;
    10171020
    1018         stylesSidebarPane.update(this.focusedDOMNode, null, forceUpdate);
     1021        stylesSidebarPane.update(this.focusedDOMNode, null, forceUpdate, this._stylesUpdated.bind(this, this.focusedDOMNode));
    10191022        stylesSidebarPane.needsUpdate = false;
     1023    },
     1024
     1025    _stylesUpdated: function(node)
     1026    {
     1027        // This method is overriden in tests.
    10201028    },
    10211029
  • trunk/Source/WebCore/inspector/front-end/StylesSidebarPane.js

    r88337 r89804  
    196196    },
    197197
    198     update: function(node, editedSection, forceUpdate)
     198    update: function(node, editedSection, forceUpdate, callback)
    199199    {
    200200        var refresh = false;
     
    221221            this._computedStylePane.bodyElement.removeChildren();
    222222            this.sections = {};
     223            if (callback)
     224                callback();
    223225            return;
    224226        }
     
    228230            if (styles)
    229231                this._rebuildUpdate(node, styles);
     232            if (callback)
     233                callback();
    230234        }
    231235
     
    234238            if (computedStyle)
    235239                this._refreshUpdate(node, computedStyle, editedSection);
    236         }
    237 
    238         function reloadAllStyles()
    239         {
    240             delete this._reloadAllStylesTimer;
    241             WebInspector.cssModel.getStylesAsync(this._allStylesNodeId, stylesCallback.bind(this))
     240            if (callback)
     241                callback();
    242242        }
    243243
    244244        if (refresh)
    245245            WebInspector.cssModel.getComputedStyleAsync(node.id, computedStyleCallback.bind(this));
    246         else {
    247             // Always refresh the node to request styles for.
    248             this._allStylesNodeId = node.id;
    249             if ("_reloadAllStylesTimer" in this)
    250                 return;
    251             this._reloadAllStylesTimer = setTimeout(reloadAllStyles.bind(this), 0);
    252         }
     246        else
     247            WebInspector.cssModel.getStylesAsync(node.id, stylesCallback.bind(this));
    253248    },
    254249
Note: See TracChangeset for help on using the changeset viewer.