Changeset 89659 in webkit
- Timestamp:
- Jun 24, 2011, 1:43:28 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r89656 r89659 1 2011-06-24 Andrey Kosyakov <caseq@chromium.org> 2 3 Reviewed by Yury Semikhatsky. 4 5 Web Inspector: extension panel iframes do not span entire panel client area 6 https://bugs.webkit.org/show_bug.cgi?id=63165 7 8 * http/tests/inspector/extensions-test.js: 9 (initialize_ExtensionsTest.InspectorTest.showPanel): 10 (): 11 * http/tests/inspector/inspector-test.js: 12 (): 13 * http/tests/inspector/resources/extension-main.html: 14 * http/tests/inspector/resources/extension-main.js: 15 (dumpObject): 16 (dumpArray): 17 (evaluateOnFrontend.callbackWrapper): 18 (evaluateOnFrontend): 19 (): 20 * http/tests/inspector/resources/extension-panel.html: 21 * inspector/extensions/extensions-events.html: 22 * inspector/extensions/extensions-expected.txt: 23 * inspector/extensions/extensions.html: 24 1 25 2011-06-24 Andrey Kosyakov <caseq@chromium.org> 2 26 -
trunk/LayoutTests/http/tests/inspector/extensions-test.js
r89656 r89659 34 34 window.addEventListener("message", InspectorTest.safeWrap(onMessage), false); 35 35 36 InspectorTest.showPanel = function(panelId) 37 { 38 if (panelId === "extension") 39 panelId = WebInspector.panelOrder[WebInspector.panelOrder.length - 1].name; 40 WebInspector.showPanel(panelId); 41 } 42 36 43 InspectorTest.runExtensionTests = function() 37 44 { … … 50 57 } 51 58 59 function extension_showPanel(panelId, callback) 60 { 61 evaluateOnFrontend("InspectorTest.showPanel(unescape('" + escape(panelId) + "')); reply();", callback); 62 } 63 52 64 var test = function() 53 65 { -
trunk/LayoutTests/http/tests/inspector/inspector-test.js
r89557 r89659 403 403 } 404 404 405 WebInspector.showPanel(" console");405 WebInspector.showPanel("audits"); 406 406 try { 407 407 testFunction(); -
trunk/LayoutTests/http/tests/inspector/resources/extension-main.html
r89656 r89659 1 1 <html> 2 2 <head> 3 <script src="extension-main.js"></script> 3 4 <script type="text/javascript"> 4 5 function dumpObject(object, nondeterministicProps, prefix, firstLinePrefix)6 {7 prefix = prefix || "";8 firstLinePrefix = firstLinePrefix || prefix;9 output(firstLinePrefix + "{");10 for (var prop in object) {11 var prefixWithName = prefix + " " + prop + " : ";12 var propValue = object[prop];13 if (nondeterministicProps && prop in nondeterministicProps)14 output(prefixWithName + "<" + typeof propValue + ">");15 else if (propValue === null)16 output(prefixWithName + "null");17 else if (typeof propValue === "object")18 dumpObject(propValue, nondeterministicProps, prefix + " ", prefixWithName);19 else if (typeof propValue === "string")20 output(prefixWithName + "\"" + propValue + "\"");21 else if (typeof propValue === "function")22 output(prefixWithName + "<function>");23 else24 output(prefixWithName + propValue);25 }26 output(prefix + "}");27 }28 29 function dumpArray(result)30 {31 if (result instanceof Array) {32 for (var i = 0; i < result.length; ++i)33 output(result[i]);34 } else35 output(result);36 }37 38 function evaluateOnFrontend(expression, callback)39 {40 function callbackWrapper(event)41 {42 channel.port1.removeEventListener("message", callbackWrapper, false);43 callback(event.data.response);44 }45 var channel = new MessageChannel();46 channel.port1.start();47 if (callback)48 channel.port1.addEventListener("message", callbackWrapper, false);49 top.postMessage({ expression: expression }, [ channel.port2 ], "*");50 }51 52 function output(message)53 {54 evaluateOnFrontend("InspectorTest.addResult(unescape('" + escape(message) + "'));");55 }56 57 5 output("Started extension."); 6 fetchTests(); 58 7 </script> 59 <script src="extension-main.js"></script>60 8 </head> 61 9 </html> -
trunk/LayoutTests/http/tests/inspector/resources/extension-main.js
r89656 r89659 1 function dumpObject(object, nondeterministicProps, prefix, firstLinePrefix) 2 { 3 prefix = prefix || ""; 4 firstLinePrefix = firstLinePrefix || prefix; 5 output(firstLinePrefix + "{"); 6 for (var prop in object) { 7 var prefixWithName = prefix + " " + prop + " : "; 8 var propValue = object[prop]; 9 if (nondeterministicProps && prop in nondeterministicProps) 10 output(prefixWithName + "<" + typeof propValue + ">"); 11 else if (propValue === null) 12 output(prefixWithName + "null"); 13 else if (typeof propValue === "object") 14 dumpObject(propValue, nondeterministicProps, prefix + " ", prefixWithName); 15 else if (typeof propValue === "string") 16 output(prefixWithName + "\"" + propValue + "\""); 17 else if (typeof propValue === "function") 18 output(prefixWithName + "<function>"); 19 else 20 output(prefixWithName + propValue); 21 } 22 output(prefix + "}"); 23 } 24 25 function dumpArray(result) 26 { 27 if (result instanceof Array) { 28 for (var i = 0; i < result.length; ++i) 29 output(result[i]); 30 } else 31 output(result); 32 } 33 34 function evaluateOnFrontend(expression, callback) 35 { 36 function callbackWrapper(event) 37 { 38 channel.port1.removeEventListener("message", callbackWrapper, false); 39 callback(event.data.response); 40 } 41 var channel = new MessageChannel(); 42 channel.port1.start(); 43 if (callback) 44 channel.port1.addEventListener("message", callbackWrapper, false); 45 top.postMessage({ expression: expression }, [ channel.port2 ], "*"); 46 } 47 48 function output(message) 49 { 50 evaluateOnFrontend("InspectorTest.addResult(unescape('" + escape(message) + "'));"); 51 } 52 1 53 function onError(event) 2 54 { … … 64 116 return function() { return func.apply(thisObject, args.concat(Array.prototype.slice.call(arguments, 0))); }; 65 117 } 66 67 fetchTests(); -
trunk/LayoutTests/http/tests/inspector/resources/extension-panel.html
r74234 r89659 1 1 <html> 2 <head> 3 <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> 12 </head> 13 <body onload="onLoad()"> 14 </body> 2 15 </html> -
trunk/LayoutTests/inspector/extensions/extensions-events.html
r89656 r89659 4 4 <script src="../../http/tests/inspector/extensions-test.js"></script> 5 5 <script type="text/javascript"> 6 7 function initialize_ExtensionEventTests()8 {9 InspectorTest.showPanel = function(panelId)10 {11 if (panelId === "extension")12 panelId = WebInspector.panelOrder[WebInspector.panelOrder.length - 1].name;13 WebInspector.showPanel(panelId);14 }15 }16 17 function extension_showPanel(panelId, callback)18 {19 evaluateOnFrontend("InspectorTest.showPanel(unescape('" + escape(panelId) + "')); reply();", callback);20 }21 6 22 7 function extension_testOnSelectionChanged(nextTest) -
trunk/LayoutTests/inspector/extensions/extensions-expected.txt
r84499 r89659 4 4 Running tests... 5 5 RUNNING TEST: extension_testCreatePanel 6 done createPanel7 6 Panel created 8 7 { … … 20 19 } 21 20 } 21 Extension panel size correct 22 22 RUNNING TEST: extension_testSidebarPage 23 23 Sidebar created -
trunk/LayoutTests/inspector/extensions/extensions.html
r89656 r89659 17 17 }); 18 18 } 19 20 InspectorTest.panelCallback = function(width, height) 21 { 22 InspectorTest.checkPanelSize(width, height); 23 var callback = InspectorTest._pendingPanelSizeTestCallback; 24 if (callback) { 25 delete InspectorTest._pendingPanelSizeTestCallback; 26 callback(); 27 } 28 } 29 30 InspectorTest.waitForPanel = function(callback) 31 { 32 InspectorTest._pendingPanelSizeTestCallback = callback; 33 } 34 35 InspectorTest.checkPanelSize = function(width, height) 36 { 37 var extensionPanel = WebInspector.panelOrder[WebInspector.panelOrder.length - 1]; 38 var boundingRect = extensionPanel.element.parentElement.getBoundingClientRect(); 39 InspectorTest.assertEquals(boundingRect.width, width, "panel width mismatch"); 40 InspectorTest.assertEquals(boundingRect.height, height, "panel height mismatch"); 41 InspectorTest.addResult("Extension panel size correct"); 42 } 19 43 } 20 44 21 45 function extension_testCreatePanel(nextTest) 22 46 { 47 var callbackCount = 0; 48 23 49 function onPanelCreated(panel) 24 50 { 25 51 output("Panel created"); 26 52 dumpObject(panel); 53 // This will force extension iframe to be really loaded and will cause waitForPanel() callback below. 54 extension_showPanel("extension"); 27 55 } 28 webInspector.panels.create("Test Panel", "extension-panel.png", "extension-panel.html", callbackAndNextTest(onPanelCreated, nextTest)); 29 output("done createPanel"); 56 // The panel code is expected to report its size via InspectorTest.panelCallback() 57 evaluateOnFrontend("InspectorTest.waitForPanel(reply);", nextTest); 58 webInspector.panels.create("Test Panel", "extension-panel.png", "extension-panel.html", onPanelCreated); 30 59 } 31 60 -
trunk/Source/WebCore/ChangeLog
r89657 r89659 1 2011-06-24 Andrey Kosyakov <caseq@chromium.org> 2 3 Reviewed by Yury Semikhatsky. 4 5 Web Inspector: extension panel iframes do not span entire panel client area 6 https://bugs.webkit.org/show_bug.cgi?id=63165 7 8 * inspector/front-end/ExtensionServer.js: 9 (WebInspector.ExtensionServer.prototype._onCreatePanel): 10 (WebInspector.ExtensionServer.prototype.createClientIframe): 11 * inspector/front-end/inspector.css: 12 (iframe.extension): 13 (iframe.panel.extension): 14 1 15 2011-06-24 David Grogan <dgrogan@chromium.org> 2 16 -
trunk/Source/WebCore/inspector/front-end/ExtensionServer.js
r87399 r89659 210 210 211 211 var iframe = this.createClientIframe(panel.element, message.url); 212 iframe. style.height = "100%";212 iframe.addStyleClass("panel"); 213 213 return this._status.OK(); 214 214 }, … … 234 234 var iframe = document.createElement("iframe"); 235 235 iframe.src = url; 236 iframe. style.width = "100%";236 iframe.addStyleClass("extension"); 237 237 parent.appendChild(iframe); 238 238 return iframe; -
trunk/Source/WebCore/inspector/front-end/inspector.css
r89558 r89659 930 930 } 931 931 932 iframe.extension { 933 width: 100%; 934 } 935 936 iframe.panel.extension { 937 display: block; 938 height: 100%; 939 } 940 932 941 .webkit-line-gutter-backdrop { 933 942 /* Keep this in sync with view-source.css (.webkit-line-gutter-backdrop) */
Note:
See TracChangeset
for help on using the changeset viewer.