Permalink
Browse files

Web Inspector: [Extensions API] simplify panel size check in extensio…

…ns-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:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122216 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information...
1 parent 9468729 commit dbc55ef823e3626ac5fa0c3e0297698f15492ece @caseq caseq committed Jul 10, 2012
View
@@ -1,3 +1,19 @@
+2012-07-09 Andrey Kosyakov <caseq@chromium.org>
+
+ 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 <kadam@inf.u-szeged.hu>
[Qt] Unreviewed gardening. Skip a flakey test after r122168.
@@ -1,15 +1,7 @@
<html>
<head>
<script src="extension-main.js"></script>
-<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>
@@ -21,8 +21,8 @@ Panel created
createStatusBarButton : <function>
show : <function>
}
-Extension panel size correct
Panel shown
+Extension panel size correct
RUNNING TEST: extension_testSearch
Panel hidden
Panel searched:
@@ -10,28 +10,14 @@
function initialize_extensionsPanelTest()
{
- InspectorTest.panelCallback = function(width, height)
- {
- 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)
+ InspectorTest.getPanelSize = function()
{
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,34 +56,53 @@
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");
dumpObject(panel);
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();
extension_showPanel("console");
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);
}
@@ -851,9 +851,6 @@ http/tests/security/referrer-policy-redirect-link.html
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
@@ -973,10 +973,6 @@ http/tests/misc/link-rel-icon-beforeload.html
# 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
@@ -438,7 +438,6 @@ inspector/debugger/breakpoint-manager.html
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

0 comments on commit dbc55ef

Please sign in to comment.