Changeset 122216 in webkit


Ignore:
Timestamp:
Jul 10, 2012 5:23:46 AM (12 years ago)
Author:
caseq@chromium.org
Message:

Web Inspector: [Extensions API] simplify panel size check in extensions-panel.html
https://bugs.webkit.org/show_bug.cgi?id=90799

Reviewed by Vsevolod Vlasov.

  • use window argument in Panel.onShown() to check panel window size;
  • http/tests/inspector/resources/extension-panel.html:
  • inspector/extensions/extensions-panel-expected.txt:
  • inspector/extensions/extensions-panel.html:
  • platform/mac/Skipped:
  • platform/qt/Skipped:
  • platform/wincairo/Skipped:
Location:
trunk/LayoutTests
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r122214 r122216  
     12012-07-09  Andrey Kosyakov  <caseq@chromium.org>
     2
     3        Web Inspector: [Extensions API] simplify panel size check in extensions-panel.html
     4        https://bugs.webkit.org/show_bug.cgi?id=90799
     5
     6        Reviewed by Vsevolod Vlasov.
     7
     8        - use window argument in Panel.onShown() to check panel window size;
     9
     10        * http/tests/inspector/resources/extension-panel.html:
     11        * inspector/extensions/extensions-panel-expected.txt:
     12        * inspector/extensions/extensions-panel.html:
     13        * platform/mac/Skipped:
     14        * platform/qt/Skipped:
     15        * platform/wincairo/Skipped:
     16
    1172012-07-10  Ádám Kallai  <kadam@inf.u-szeged.hu>
    218
  • trunk/LayoutTests/http/tests/inspector/resources/extension-panel.html

    r89659 r122216  
    22<head>
    33<script src="extension-main.js"></script>
    4 <script type="text/javascript">
    5 function onLoad()
    6 {
    7     var width = window.innerWidth;
    8     var height = window.innerHeight;
    9     evaluateOnFrontend("if (InspectorTest.panelCallback) InspectorTest.panelCallback(" + width + "," + height +");");
    10 }
    11 </script>
    124</head>
    13 <body onload="onLoad()">
     5<body>
    146</body>
    157</html>
  • trunk/LayoutTests/inspector/extensions/extensions-panel-expected.txt

    r121046 r122216  
    2222    show : <function>
    2323}
     24Panel shown
    2425Extension panel size correct
    25 Panel shown
    2626RUNNING TEST: extension_testSearch
    2727Panel hidden
  • trunk/LayoutTests/inspector/extensions/extensions-panel.html

    r121046 r122216  
    1111function initialize_extensionsPanelTest()
    1212{
    13     InspectorTest.panelCallback = function(width, height)
    14     {
    15         InspectorTest.checkPanelSize(width, height);
    16         var callback = InspectorTest._pendingPanelSizeTestCallback;
    17         if (callback) {
    18             delete InspectorTest._pendingPanelSizeTestCallback;
    19             callback();
    20         }
    21     }
    22 
    23     InspectorTest.waitForPanel = function(callback)
    24     {
    25          InspectorTest._pendingPanelSizeTestCallback = callback;
    26     }
    27 
    28     InspectorTest.checkPanelSize = function(width, height)
     13    InspectorTest.getPanelSize = function()
    2914    {
    3015        var extensionPanel = WebInspector.inspectorView._panelOrder[WebInspector.inspectorView._panelOrder.length - 1];
    3116        var boundingRect = document.getElementById("main-panels").getBoundingClientRect();
    32         InspectorTest.assertEquals(boundingRect.width, width, "panel width mismatch");
    33         InspectorTest.assertEquals(boundingRect.height, height, "panel height mismatch");
    34         InspectorTest.addResult("Extension panel size correct");
     17        return {
     18            width: boundingRect.width,
     19            height: boundingRect.height
     20        };
    3521    }
    3622
     
    7157function extension_testCreatePanel(nextTest)
    7258{
     59    var expectOnShown = false;
     60
     61    function onPanelShown(panel, window)
     62    {
     63        if (!expectOnShown) {
     64            output("FAIL: unexpected onShown event");
     65            nextTest();
     66            return;
     67        }
     68        output("Panel shown");
     69        panel.onShown.removeListener(onPanelShown);
     70        evaluateOnFrontend("reply(InspectorTest.getPanelSize())", function(result) {
     71            if (result.width !== window.innerWidth)
     72                output("panel width mismatch, outer: " + result.width + ", inner:" + window.innerWidth);
     73            else if (result.height !== window.innerHeight)
     74                output("panel height mismatch, outer: " + result.height + ", inner:" + window.innerHeight);
     75            else
     76                output("Extension panel size correct");
     77            nextTest();
     78        });
     79    }
     80
    7381    function onPanelCreated(panel)
    7482    {
     
    7886            output("Panel hidden");
    7987        });
    80         panel.onShown.addListener(function(window) {
    81             output("Panel shown");
    82         });
     88        panel.onShown.addListener(onPanelShown.bind(this, panel));
    8389
    8490        // This is not authorized and therefore should not produce any output
     
    8894        function handleOpenResource(resource, lineNumber)
    8995        {
    90             // This will force extension iframe to be really loaded and will cause waitForPanel() callback below.
     96            // This will force extension iframe to be really loaded.
    9197            panel.show();
    9298        }
     
    94100        evaluateOnFrontend("WebInspector.openAnchorLocationRegistry._activeHandler = 'test extension'");
    95101        webInspector.inspectedWindow.eval("logMessage()", function() {
     102            expectOnShown = true;
    96103            evaluateOnFrontend("InspectorTest.clickOnURL();");
    97104        });
    98105    }
    99     // The panel code is expected to report its size via InspectorTest.panelCallback()
    100     evaluateOnFrontend("InspectorTest.waitForPanel(reply);", nextTest);
    101106    var basePath = location.pathname.replace(/\/[^/]*$/, "/");
    102107    webInspector.panels.create("Test Panel", basePath + "extension-panel.png", basePath + "extension-panel.html", onPanelCreated);
  • trunk/LayoutTests/platform/mac/Skipped

    r122165 r122216  
    852852inspector/extensions/extensions-audits-content-script.html
    853853
    854 # https://bugs.webkit.org/show_bug.cgi?id=89790
    855 inspector/extensions/extensions-panel.html
    856 
    857854# https://bugs.webkit.org/show_bug.cgi?id=86480
    858855plugins/npruntime/delete-plugin-within-setProperty.html
  • trunk/LayoutTests/platform/qt/Skipped

    r122214 r122216  
    973973# https://bugs.webkit.org/show_bug.cgi?id=64002
    974974fast/selectors/unqualified-hover-strict.html
    975 
    976 # [Qt] inspector/extensions/extensions-panel.html is flakey
    977 # https://bugs.webkit.org/show_bug.cgi?id=89333
    978 inspector/extensions/extensions-panel.html
    979975
    980976# [Qt] http/tests/misc/script-defer.html is flakey
  • trunk/LayoutTests/platform/wincairo/Skipped

    r121907 r122216  
    439439inspector/extensions/extensions-console.html
    440440inspector/extensions/extensions-events.html
    441 inspector/extensions/extensions-panel.html
    442441inspector/styles/styles-invalid-color-values.html
    443442inspector/timeline/timeline-animation-frame.html
Note: See TracChangeset for help on using the changeset viewer.