Title: [122216] trunk/LayoutTests
Revision
122216
Author
[email protected]
Date
2012-07-10 05:23:46 -0700 (Tue, 10 Jul 2012)

Log 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:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (122215 => 122216)


--- trunk/LayoutTests/ChangeLog	2012-07-10 12:10:47 UTC (rev 122215)
+++ trunk/LayoutTests/ChangeLog	2012-07-10 12:23:46 UTC (rev 122216)
@@ -1,3 +1,19 @@
+2012-07-09  Andrey Kosyakov  <[email protected]>
+
+        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:
+
 2012-07-10  Ádám Kallai  <[email protected]>
 
         [Qt] Unreviewed gardening. Skip a flakey test after r122168.

Modified: trunk/LayoutTests/http/tests/inspector/resources/extension-panel.html (122215 => 122216)


--- trunk/LayoutTests/http/tests/inspector/resources/extension-panel.html	2012-07-10 12:10:47 UTC (rev 122215)
+++ trunk/LayoutTests/http/tests/inspector/resources/extension-panel.html	2012-07-10 12:23:46 UTC (rev 122216)
@@ -1,15 +1,7 @@
 <html>
 <head>
 <script src=""
-<script type="text/_javascript_">
-function onLoad()
-{
-    var width = window.innerWidth;
-    var height = window.innerHeight;
-    evaluateOnFrontend("if (InspectorTest.panelCallback) InspectorTest.panelCallback(" + width + "," + height +");");
-}
-</script>
 </head>
-<body _onload_="onLoad()">
+<body>
 </body>
 </html>

Modified: trunk/LayoutTests/inspector/extensions/extensions-panel-expected.txt (122215 => 122216)


--- trunk/LayoutTests/inspector/extensions/extensions-panel-expected.txt	2012-07-10 12:10:47 UTC (rev 122215)
+++ trunk/LayoutTests/inspector/extensions/extensions-panel-expected.txt	2012-07-10 12:23:46 UTC (rev 122216)
@@ -21,8 +21,8 @@
     createStatusBarButton : <function>
     show : <function>
 }
+Panel shown
 Extension panel size correct
-Panel shown
 RUNNING TEST: extension_testSearch
 Panel hidden
 Panel searched:

Modified: trunk/LayoutTests/inspector/extensions/extensions-panel.html (122215 => 122216)


--- trunk/LayoutTests/inspector/extensions/extensions-panel.html	2012-07-10 12:10:47 UTC (rev 122215)
+++ trunk/LayoutTests/inspector/extensions/extensions-panel.html	2012-07-10 12:23:46 UTC (rev 122216)
@@ -10,28 +10,14 @@
 
 function initialize_extensionsPanelTest()
 {
-    InspectorTest.panelCallback = function(width, height)
+    InspectorTest.getPanelSize = function()
     {
-        InspectorTest.checkPanelSize(width, height);
-        var callback = InspectorTest._pendingPanelSizeTestCallback;
-        if (callback) {
-            delete InspectorTest._pendingPanelSizeTestCallback;
-            callback();
-        }
-    }
-
-    InspectorTest.waitForPanel = function(callback)
-    {
-         InspectorTest._pendingPanelSizeTestCallback = callback;
-    }
-
-    InspectorTest.checkPanelSize = function(width, height)
-    {
         var extensionPanel = WebInspector.inspectorView._panelOrder[WebInspector.inspectorView._panelOrder.length - 1];
         var boundingRect = document.getElementById("main-panels").getBoundingClientRect();
-        InspectorTest.assertEquals(boundingRect.width, width, "panel width mismatch");
-        InspectorTest.assertEquals(boundingRect.height, height, "panel height mismatch");
-        InspectorTest.addResult("Extension panel size correct");
+        return {
+            width: boundingRect.width,
+            height: boundingRect.height
+        };
     }
 
     InspectorTest.dumpStatusBarButtons = function()
@@ -70,6 +56,28 @@
 
 function extension_testCreatePanel(nextTest)
 {
+    var expectOnShown = false;
+
+    function onPanelShown(panel, window)
+    {
+        if (!expectOnShown) {
+            output("FAIL: unexpected onShown event");
+            nextTest();
+            return;
+        }
+        output("Panel shown");
+        panel.onShown.removeListener(onPanelShown);
+        evaluateOnFrontend("reply(InspectorTest.getPanelSize())", function(result) {
+            if (result.width !== window.innerWidth)
+                output("panel width mismatch, outer: " + result.width + ", inner:" + window.innerWidth);
+            else if (result.height !== window.innerHeight)
+                output("panel height mismatch, outer: " + result.height + ", inner:" + window.innerHeight);
+            else
+                output("Extension panel size correct");
+            nextTest();
+        });
+    }
+
     function onPanelCreated(panel)
     {
         output("Panel created");
@@ -77,9 +85,7 @@
         panel.onHidden.addListener(function() {
             output("Panel hidden");
         });
-        panel.onShown.addListener(function(window) {
-            output("Panel shown");
-        });
+        panel.onShown.addListener(onPanelShown.bind(this, panel));
 
         // This is not authorized and therefore should not produce any output
         panel.show();
@@ -87,17 +93,16 @@
 
         function handleOpenResource(resource, lineNumber)
         {
-            // This will force extension iframe to be really loaded and will cause waitForPanel() callback below.
+            // This will force extension iframe to be really loaded.
             panel.show();
         }
         webInspector.panels.setOpenResourceHandler(handleOpenResource);
         evaluateOnFrontend("WebInspector.openAnchorLocationRegistry._activeHandler = 'test extension'");
         webInspector.inspectedWindow.eval("logMessage()", function() {
+            expectOnShown = true;
             evaluateOnFrontend("InspectorTest.clickOnURL();");
         });
     }
-    // The panel code is expected to report its size via InspectorTest.panelCallback()
-    evaluateOnFrontend("InspectorTest.waitForPanel(reply);", nextTest);
     var basePath = location.pathname.replace(/\/[^/]*$/, "/");
     webInspector.panels.create("Test Panel", basePath + "extension-panel.png", basePath + "extension-panel.html", onPanelCreated);
 }

Modified: trunk/LayoutTests/platform/mac/Skipped (122215 => 122216)


--- trunk/LayoutTests/platform/mac/Skipped	2012-07-10 12:10:47 UTC (rev 122215)
+++ trunk/LayoutTests/platform/mac/Skipped	2012-07-10 12:23:46 UTC (rev 122216)
@@ -851,9 +851,6 @@
 inspector/extensions/extensions-eval-content-script.html
 inspector/extensions/extensions-audits-content-script.html
 
-# https://bugs.webkit.org/show_bug.cgi?id=89790
-inspector/extensions/extensions-panel.html
-
 # https://bugs.webkit.org/show_bug.cgi?id=86480
 plugins/npruntime/delete-plugin-within-setProperty.html
 plugins/npruntime/delete-plugin-within-hasProperty-return-true.html

Modified: trunk/LayoutTests/platform/qt/Skipped (122215 => 122216)


--- trunk/LayoutTests/platform/qt/Skipped	2012-07-10 12:10:47 UTC (rev 122215)
+++ trunk/LayoutTests/platform/qt/Skipped	2012-07-10 12:23:46 UTC (rev 122216)
@@ -973,10 +973,6 @@
 # https://bugs.webkit.org/show_bug.cgi?id=64002
 fast/selectors/unqualified-hover-strict.html
 
-# [Qt] inspector/extensions/extensions-panel.html is flakey
-# https://bugs.webkit.org/show_bug.cgi?id=89333
-inspector/extensions/extensions-panel.html
-
 # [Qt] http/tests/misc/script-defer.html is flakey
 # https://bugs.webkit.org/show_bug.cgi?id=90845
 http/tests/misc/script-defer.html

Modified: trunk/LayoutTests/platform/wincairo/Skipped (122215 => 122216)


--- trunk/LayoutTests/platform/wincairo/Skipped	2012-07-10 12:10:47 UTC (rev 122215)
+++ trunk/LayoutTests/platform/wincairo/Skipped	2012-07-10 12:23:46 UTC (rev 122216)
@@ -438,7 +438,6 @@
 inspector/debugger/raw-source-code.html
 inspector/extensions/extensions-console.html
 inspector/extensions/extensions-events.html
-inspector/extensions/extensions-panel.html
 inspector/styles/styles-invalid-color-values.html
 inspector/timeline/timeline-animation-frame.html 
 inspector/timeline/timeline-load-event.html
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to