Commit da50e955 authored by caseq@chromium.org's avatar caseq@chromium.org

2010-11-24 Andrey Kosyakov <caseq@chromium.org>

        Reviewed by Pavel Feldman.

        Web Inspector: extension API cleanup
        https://bugs.webkit.org/show_bug.cgi?id=50019

        * inspector/front-end/ElementsPanel.js:
        (WebInspector.ElementsPanel.this.treeOutline.focusedNodeChanged):
        (WebInspector.ElementsPanel):
        * inspector/front-end/ExtensionAPI.js: See bug for summary of extension API changes.
        (WebInspector.injectedExtensionAPI.Resources.resourceDispatch):
        (WebInspector.injectedExtensionAPI):
        (WebInspector.injectedExtensionAPI.Resources.prototype.getHAR):
        (WebInspector.injectedExtensionAPI.ResourceImpl.prototype.getContent):
        (WebInspector.injectedExtensionAPI.Panels.prototype.create):
        (WebInspector.injectedExtensionAPI.PanelImpl):
        (WebInspector.injectedExtensionAPI.PanelWithSidebarImpl):
        (WebInspector.injectedExtensionAPI.PanelWithSidebarImpl.prototype.createSidebarPane):
        (WebInspector.injectedExtensionAPI.PanelWithSidebarImpl.prototype.createWatchExpressionSidebarPane):
        (WebInspector.injectedExtensionAPI.ElementsPanel):
        (WebInspector.injectedExtensionAPI.ExtensionSidebarPaneImpl.prototype.setHeight):
        (WebInspector.injectedExtensionAPI.Audits.prototype.addCategory):
        (WebInspector.injectedExtensionAPI.AuditCategoryImpl.auditResultDispatch):
        (WebInspector.injectedExtensionAPI.AuditCategoryImpl):
        (WebInspector.injectedExtensionAPI.AuditResultImpl.prototype.get Severity):
        (WebInspector.injectedExtensionAPI.InspectedWindow):
        (WebInspector.injectedExtensionAPI.InspectedWindow.prototype.eval):
        * inspector/front-end/ExtensionCommon.js:
        (WebInspector.commonExtensionSymbols):
        * inspector/front-end/ExtensionServer.js:
        (WebInspector.ExtensionServer):
        (WebInspector.ExtensionServer.prototype.notifyObjectSelected):
        (WebInspector.ExtensionServer.prototype.notifyResourceFinished):
        (WebInspector.ExtensionServer.prototype.notifyPageLoaded):
        (WebInspector.ExtensionServer.prototype.notifyPageDOMContentLoaded):
        (WebInspector.ExtensionServer.prototype._onCreatePanel):
        (WebInspector.ExtensionServer.prototype._onReload):
        (WebInspector.ExtensionServer.prototype._onGetHAR):
        (WebInspector.ExtensionServer.prototype._onGetResourceContent):
        (WebInspector.ExtensionServer.prototype._onAddAuditCategory):
        (WebInspector.ExtensionServer.prototype._buildExtensionAPIInjectedScript):
        * inspector/front-end/HAREntry.js:
        (WebInspector.HARLog):
        (WebInspector.HARLog.prototype.build):
        (WebInspector.HARLog.prototype._convertResource):
        * inspector/front-end/inspector.js:
        (WebInspector.domContentEventFired):
        (WebInspector.loadEventFired):
        (WebInspector.didCommitLoad):

2010-11-24  Andrey Kosyakov  <caseq@chromium.org>

        Reviewed by Pavel Feldman.

        Web Inspector: extension API cleanup
        Improve synchronization between different parts of the test to reduce flakiness.
        https://bugs.webkit.org/show_bug.cgi?id=50019

        * http/tests/inspector/inspector-test2.js: Clean inspected page test output before pushing output from front-end.
        (initialize_InspectorTest.InspectorTest.completeTest): Delay test completion until page's onload is completed after reload.
        (initialize_InspectorTest.InspectorTest.addResult.clearResults):
        (initialize_InspectorTest.InspectorTest.reloadPageIfNeeded):
        (output):
        * inspector/extensions-api-expected.txt:
        * inspector/extensions-audits-api-expected.txt:
        * inspector/extensions-audits-expected.txt:
        * inspector/extensions-audits-tests.js:
        (extension_runAudits):
        (initialize_ExtensionsAuditsTest.InspectorTest.startExtensionAudits.onAuditsDone):
        (initialize_ExtensionsAuditsTest.InspectorTest.startExtensionAudits):
        (initialize_ExtensionsAuditsTest):
        (test):
        * inspector/extensions-eval-expected.txt:
        * inspector/extensions-eval.html:
        * inspector/extensions-events-expected.txt:
        * inspector/extensions-events.html:
        * inspector/extensions-resources-expected.txt:
        * inspector/extensions-resources.html:
        * inspector/extensions-test.js:
        (initialize_ExtensionsTest.InspectorTest.dispatchOnMessage):
        (initialize_ExtensionsTest.InspectorTest.runExtensionTests):
        (initialize_ExtensionsTest.extensionOutput):
        (initialize_ExtensionsTest.dumpSidebarContent):
        (initialize_ExtensionsTest.reloadPage):
        * inspector/extensions.html:
        * inspector/resources/extension-main.html:
        * inspector/resources/extension-main.js:
        (fetchTests.callback):
        (fetchTests):
        (onTestsDone):
        (dispatchOnFrontend):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@72683 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent f532b93d
2010-11-24 Andrey Kosyakov <caseq@chromium.org>
Reviewed by Pavel Feldman.
Web Inspector: extension API cleanup
Improve synchronization between different parts of the test to reduce flakiness.
https://bugs.webkit.org/show_bug.cgi?id=50019
* http/tests/inspector/inspector-test2.js: Clean inspected page test output before pushing output from front-end.
(initialize_InspectorTest.InspectorTest.completeTest): Delay test completion until page's onload is completed after reload.
(initialize_InspectorTest.InspectorTest.addResult.clearResults):
(initialize_InspectorTest.InspectorTest.reloadPageIfNeeded):
(output):
* inspector/extensions-api-expected.txt:
* inspector/extensions-audits-api-expected.txt:
* inspector/extensions-audits-expected.txt:
* inspector/extensions-audits-tests.js:
(extension_runAudits):
(initialize_ExtensionsAuditsTest.InspectorTest.startExtensionAudits.onAuditsDone):
(initialize_ExtensionsAuditsTest.InspectorTest.startExtensionAudits):
(initialize_ExtensionsAuditsTest):
(test):
* inspector/extensions-eval-expected.txt:
* inspector/extensions-eval.html:
* inspector/extensions-events-expected.txt:
* inspector/extensions-events.html:
* inspector/extensions-resources-expected.txt:
* inspector/extensions-resources.html:
* inspector/extensions-test.js:
(initialize_ExtensionsTest.InspectorTest.dispatchOnMessage):
(initialize_ExtensionsTest.InspectorTest.runExtensionTests):
(initialize_ExtensionsTest.extensionOutput):
(initialize_ExtensionsTest.dumpSidebarContent):
(initialize_ExtensionsTest.reloadPage):
* inspector/extensions.html:
* inspector/resources/extension-main.html:
* inspector/resources/extension-main.js:
(fetchTests.callback):
(fetchTests):
(onTestsDone):
(dispatchOnFrontend):
2010-11-23 Jeremy Orlow <jorlow@chromium.org>
Reviewed by Steve Block.
......@@ -38,11 +38,17 @@ InspectorTest.addResult = function(text)
if (resultsSynchronized)
addResultToPage(text);
else {
clearResults();
for (var i = 0; i < results.length; ++i)
addResultToPage(results[i]);
resultsSynchronized = true;
}
function clearResults()
{
InspectorTest.evaluateInPage("Array.prototype.forEach.call(document.body.querySelectorAll('div.output'), function(node) { node.parentNode.removeChild(node); })");
}
function addResultToPage(text)
{
InspectorTest.evaluateInPage("output(unescape('" + escape(text) + "'))");
......@@ -87,8 +93,10 @@ InspectorTest.reloadPageIfNeeded = function(callback)
if (!InspectorTest._pageWasReloaded) {
InspectorTest._pageWasReloaded = true;
InspectorTest.reloadPage(callback);
} else
callback();
} else {
if (callback)
callback();
}
}
InspectorTest.pageReloaded = function()
......@@ -229,7 +237,7 @@ function didEvaluateForTestInFrontend(callId)
function output(text)
{
var outputElement = document.createElement("div");
outputElement.id = "output";
outputElement.className = "output";
outputElement.style.whiteSpace = "pre";
outputElement.appendChild(document.createTextNode(text));
outputElement.appendChild(document.createElement("br"));
......
Tests public interface of WebInspector Extensions API
Page reloaded.
Started extension.
Running tests...
RUNNING TEST: extension_testAPI
......@@ -9,37 +8,29 @@ RUNNING TEST: extension_testAPI
addCategory : <function>
}
inspectedWindow : {
onLoaded : {
onDOMContentLoaded : {
addListener : <function>
removeListener : <function>
}
onNavigated : {
onLoaded : {
addListener : <function>
removeListener : <function>
}
onDOMContentLoaded : {
onNavigated : {
addListener : <function>
removeListener : <function>
}
reload : <function>
evaluate : <function>
eval : <function>
}
panels : {
elements : {
onSelectionChanged : {
addListener : <function>
removeListener : <function>
}
createSidebarPane : <function>
createWatchExpressionSidebarPane : <function>
}
scripts : {
onSelectionChanged : {
addListener : <function>
removeListener : <function>
}
createSidebarPane : <function>
createWatchExpressionSidebarPane : <function>
}
create : <function>
}
......@@ -59,10 +50,7 @@ RUNNING TEST: extension_testAPI
WebSocket : "websocket"
Other : "other"
}
getAll : <function>
get : <function>
getPageTimings : <function>
getContent : <function>
getHAR : <function>
}
onReset : {
addListener : <function>
......
Tests audits support in WebInspector Extensions API
Page reloaded.
Started extension.
Running tests...
RUNNING TEST: extension_testAuditsAPI
......@@ -11,6 +10,7 @@ Added audit category, result dump follows:
removeListener : <function>
}
}
Extension audits
category.onAuditStarted fired, results dump follows:
{
url : <function>
......@@ -34,6 +34,5 @@ category.onAuditStarted fired, results dump follows:
expanded : false
addChild : <function>
}
Extension audits
All tests done.
Tests audits support in WebInspector Extensions API
Page reloaded.
Started extension.
Running tests...
RUNNING TEST: extension_testAudits
Added audit category.
category.onAuditStarted fired
failedCategory.onAuditStarted fired, throwing exception
Extension audits
Failed rule (42)
this rule always fails
......@@ -25,5 +22,7 @@ failedCategory.onAuditStarted fired, throwing exception
Passed rule
this rule always passes ok
Extension audits that fail
category.onAuditStarted fired
failedCategory.onAuditStarted fired, throwing exception
All tests done.
function extension_runAudits(callback)
{
function onMessage(event)
{
if (event.data === "audits-complete")
callback();
}
window.addEventListener("message", onMessage, false);
top.postMessage("run-audits", "*");
dispatchOnFrontend({ command: "run-audits" }, callback);
}
// runs in front-end
var initialize_ExtensionsAuditsTest = function()
{
InspectorTest.startExtensionAudits = function()
InspectorTest.startExtensionAudits = function(message, port)
{
const launcherView = WebInspector.panels.audits._launcherView;
launcherView._selectAllClicked(false);
......@@ -27,11 +21,10 @@ var initialize_ExtensionsAuditsTest = function()
function onAuditsDone()
{
InspectorTest.collectAuditResults();
for (var i = 0; i < frames.length; ++i)
frames[i].postMessage("audits-complete", "*");
port.postMessage("");
}
InspectorTest._addSniffer(WebInspector.panels.audits, "_auditFinishedCallback", onAuditsDone, true);
launcherView._launchButtonClicked();
}
}
......@@ -41,4 +34,3 @@ var test = function()
InspectorTest.dispatchOnMessage("run-audits", InspectorTest.startExtensionAudits);
InspectorTest.runExtensionTests();
}
Tests WebInspector extension API
Page reloaded.
Started extension.
Running tests...
RUNNING TEST: extension_testEvalConsoleAPI
......
......@@ -8,39 +8,39 @@ window.inspectedValue = { str: "foo", num: 42 };
function extension_testEvalOk(nextTest)
{
webInspector.inspectedWindow.evaluate("inspectedValue", callbackAndNextTest(extension_onEvaluate, nextTest));
webInspector.inspectedWindow.eval("inspectedValue", callbackAndNextTest(extension_onEval, nextTest));
}
function extension_testEvalFailed(nextTest)
{
webInspector.inspectedWindow.evaluate("document.body", callbackAndNextTest(extension_onEvaluate, nextTest));
webInspector.inspectedWindow.eval("document.body", callbackAndNextTest(extension_onEval, nextTest));
}
function extension_testEvalDefinesGlobalSymbols(nextTest)
{
webInspector.inspectedWindow.evaluate("function extensionFunc() {}");
webInspector.inspectedWindow.evaluate("extensionVar = 42;");
webInspector.inspectedWindow.evaluate("({ func: typeof window.extensionFunc, variable: window.extensionVar })", callbackAndNextTest(extension_onEvaluate, nextTest));
webInspector.inspectedWindow.eval("function extensionFunc() {}");
webInspector.inspectedWindow.eval("extensionVar = 42;");
webInspector.inspectedWindow.eval("({ func: typeof window.extensionFunc, variable: window.extensionVar })", callbackAndNextTest(extension_onEval, nextTest));
}
function extension_testEvalStatement(nextTest)
{
webInspector.inspectedWindow.evaluate("var x = 3; while (--x); x", callbackAndNextTest(extension_onEvaluate, nextTest));
webInspector.inspectedWindow.eval("var x = 3; while (--x); x", callbackAndNextTest(extension_onEval, nextTest));
}
function extension_testEvalUndefined(nextTest)
{
webInspector.inspectedWindow.evaluate("undefined", callbackAndNextTest(extension_onEvaluate, nextTest));
webInspector.inspectedWindow.eval("undefined", callbackAndNextTest(extension_onEval, nextTest));
}
function extension_testEvalConsoleAPI(nextTest)
{
webInspector.inspectedWindow.evaluate("typeof inspect", callbackAndNextTest(extension_onEvaluate, nextTest));
webInspector.inspectedWindow.eval("typeof inspect", callbackAndNextTest(extension_onEval, nextTest));
}
function extension_onEvaluate(result)
function extension_onEval(value, isException)
{
output("Evaluate: " + JSON.stringify(result.value) + " (exception: " + result.isException + ")");
output("Evaluate: " + JSON.stringify(value) + " (exception: " + isException + ")");
}
</script>
......
CONSOLE MESSAGE: line 669: [object HTMLParagraphElement]
Tests WebInspector extension API
Page reloaded.
Started extension.
Running tests...
RUNNING TEST: extension_testOnResourceFinished
Got callback, arguments dump follows:
{
0 : {
id : <number>
type : "other"
har : <object>
}
}
onFinished fired
RUNNING TEST: extension_testOnSelectionChanged
Got callback, arguments dump follows:
{
0 : "DOMNode"
1 : undefined
}
onSelectionChanged fired
RUNNING TEST: extension_testPageLoadEvents
onDOMContentLoaded fired: number
onLoaded fired: number
Page reloaded.
All tests done.
......@@ -4,26 +4,46 @@
<script src="extensions-test.js"></script>
<script type="text/javascript">
function extension_callback(nondetermenisticProps)
{
output("Got callback, arguments dump follows:");
dumpObject(Array.prototype.slice.call(arguments, 1), nondetermenisticProps);
}
function extension_testOnSelectionChanged(nextTest)
{
webInspector.panels.elements.onSelectionChanged.addListener(callbackAndNextTest(bind(extension_callback, null, null), nextTest));
webInspector.inspectedWindow.evaluate("inspect(document.body.children[0])");
function onSelectionChanged()
{
webInspector.panels.elements.onSelectionChanged.removeListener(onSelectionChanged);
output("onSelectionChanged fired");
nextTest();
}
webInspector.panels.elements.onSelectionChanged.addListener(onSelectionChanged);
webInspector.inspectedWindow.eval("inspect(document.body.children[0])");
}
function extension_testOnResourceFinished(nextTest)
{
var nondetermenisticProps = {
har: 1,
id: 1
};
webInspector.resources.onFinished.addListener(callbackAndNextTest(bind(extension_callback, null, nondetermenisticProps), nextTest));
webInspector.inspectedWindow.evaluate("var xhr = new XMLHttpRequest(); xhr.open('GET', '" + location.href + "', false); xhr.send(null);");
function onFinished()
{
webInspector.resources.onFinished.removeListener(onFinished);
output("onFinished fired");
nextTest();
}
webInspector.resources.onFinished.addListener(onFinished);
webInspector.inspectedWindow.eval("var xhr = new XMLHttpRequest(); xhr.open('GET', '" + location.href + "', false); xhr.send(null);");
}
function extension_testPageLoadEvents(nextTest)
{
var callbackCount = 0;
webInspector.inspectedWindow.onDOMContentLoaded.addListener(function(time) {
output("onDOMContentLoaded fired: " + typeof time);
});
webInspector.inspectedWindow.onLoaded.addListener(function(time) {
output("onLoaded fired: " + typeof time);
if (++callbackCount > 1)
nextTest();
});
dispatchOnFrontend({ command: "reload" }, function() {
if (++callbackCount > 1)
nextTest();
});
}
</script>
......
Tests WebInspector extension API
Page reloaded.
Started extension.
Running tests...
RUNNING TEST: extension_testCreatePanel
done createPanel
Panel created
{
onSelectionChanged : {
addListener : <function>
removeListener : <function>
}
createSidebarPane : <function>
createWatchExpressionSidebarPane : <function>
onSearch : {
addListener : <function>
removeListener : <function>
......@@ -22,10 +15,9 @@ RUNNING TEST: extension_testCreateSidebar
Sidebar created
{
setHeight : <function>
setExpanded : <function>
}
RUNNING TEST: extension_testExtensionWatchSidebarExpression
Sidebar content: titlef0: "expression"f1: undefinedf2: nullf3: Objectf4: Array[0]f5: Array[3]f6: Objectf7: 42f8: Locationf9: HTMLCollection[26]f10: function () {}__proto__: Object
Sidebar content: titlef0: "expression"f1: undefinedf2: nullf3: Objectf4: Array[0]f5: Array[3]f6: Objectf7: 42f8: Locationf9: HTMLCollection[18]f10: function () {}__proto__: Object
RUNNING TEST: extension_testExtensionWatchSidebarObject
Watch sidebar created, callback arguments dump follows:
{
......@@ -37,7 +29,6 @@ Watch sidebar created, callback arguments dump follows:
setExpression : <function>
setObject : <function>
setHeight : <function>
setExpanded : <function>
}
}
Sidebar content: f0: "object"f1: undefinedf2: nullf3: { }f4: [0]f5: [3]f6: {...}f7: 42
......
......@@ -14,44 +14,25 @@ p { font-family: 'test'; }
<script src="extensions-test.js"></script>
<script type="text/javascript">
function extension_testGetAllResources(nextTest)
function extension_testGetHAR(nextTest)
{
function compareResources(a, b)
function compareEntries(a, b)
{
return a.har.request.url.toLowerCase().localeCompare(b.har.request.url.toLowerCase());
return a.request.url.toLowerCase().localeCompare(b.request.url.toLowerCase());
}
function onResource(result)
function onHAR(result)
{
var resources = result.sort(compareResources);
result.entries.sort(compareEntries);
for (var i = 0; i < resources.length; ++i)
output("resource: " + resources[i].har.request.url.replace(/.*((\/[^/]*){3}$)/,"...$1") + ", type: " + resources[i].type);
for (var i = 0; i < result.entries.length; ++i)
output("resource: " + result.entries[i].request.url.replace(/.*((\/[^/]*){3}$)/,"...$1"));
}
extension_doXHR(function() {
webInspector.resources.getAll(callbackAndNextTest(onResource, nextTest));
webInspector.resources.getHAR(callbackAndNextTest(onHAR, nextTest));
});
}
function extension_testGetInvalidResource(nextTest)
{
function onResource(result)
{
output("Attempted to retrieve invalid resource: " + JSON.stringify(result));
}
webInspector.resources.get(2128506, callbackAndNextTest(onResource, nextTest));
}
function extension_testGetPageTimings(nextTest)
{
function onTimings(result)
{
output("Got callback from getPageTimings, pageTimings dump follows");
dumpObject(result, { onContentLoad: 1, onLoad: 1 });
}
webInspector.resources.getPageTimings(callbackAndNextTest(onTimings, nextTest));
}
function doXHR()
{
var xhr = new XMLHttpRequest();
......@@ -61,14 +42,14 @@ function doXHR()
function extension_doXHR(callback)
{
webInspector.inspectedWindow.evaluate("doXHR()", callback);
webInspector.inspectedWindow.eval("doXHR()", callback);
}
function extension_testResourceNotification(nextTest)
{
function onResourceFinished(resource)
{
output("Resource finished: " + resource.har.request.url.replace(/.*((\/[^/]*){3}$)/,"...$1"));
output("Resource finished: " + resource.request.url.replace(/.*((\/[^/]*){3}$)/,"...$1"));
}
webInspector.resources.onFinished.addListener(callbackAndNextTest(onResourceFinished, nextTest));
......@@ -77,44 +58,45 @@ function extension_testResourceNotification(nextTest)
function extension_getResourceByUrl(urls, callback)
{
function onGotResources(response)
function onHAR(response)
{
var ids = [];
for (var i = 0; i < response.length; ++i) {
var entries = response.entries;
for (var i = 0; i < entries.length; ++i) {
for (var url = 0; url < urls.length; ++url) {
if (urls[url].test(response[i].har.request.url))
ids.push(response[i].id);
if (urls[url].test(entries[i].request.url)) {
callback(entries[i]);
return;
}
}
}
callback(ids);
}
webInspector.resources.getAll(onGotResources);
webInspector.resources.getHAR(onHAR);
}
function extension_onResourceBodies(response)
function extension_onResourceBody(content, encoding)
{
function compareBodies(a, b)
{
return ((a.response && a.response.content) || "").localeCompare((b.response && b.response.content) || "");
}
dumpObject(response, { id: 1 });
dumpObject(Array.prototype.slice.call(arguments));
}
function extension_testGetResourceContent(nextTest)
{
extension_getResourceByUrl([/audits-style1.css$/], function(ids) {
webInspector.resources.getContent(ids[0], callbackAndNextTest(extension_onResourceBodies, nextTest));
extension_getResourceByUrl([/audits-style1.css$/], function(resource) {
resource.getContent(callbackAndNextTest(extension_onResourceBody, nextTest));
});
}
function extension_testGetResourceContent(nextTest)
function extension_testGetResourceContentEncoded(nextTest)
{
extension_getResourceByUrl([/abe.png$/, /missing-image.png$/, /audits-style1.css$/ ], function(ids) {
ids.push(2126506); // Non-existent resource id.
webInspector.resources.getContent(ids, callbackAndNextTest(extension_onResourceBodies, nextTest));
extension_getResourceByUrl([/abe.png$/ ], function(resource) {
resource.getContent(callbackAndNextTest(extension_onResourceBody, nextTest));
});
}
var test = function()
{
InspectorTest.reloadPage(InspectorTest.runExtensionTests);
}
</script>
</head>
<body onload="runTest()">
......
......@@ -21,43 +21,50 @@ InspectorTest.dispatchOnMessage = function(messageId, callback, recurring)
{
function onMessage(event)
{
if (event.data !== messageId)
if (typeof(event.data) !== "object" || event.data.command !== messageId)
return;
if (!recurring)
window.removeEventListener("message", onMessage, false);
callback();
if (event.ports && event.ports[0])
event.ports[0].postMessage("");
var port = event.ports && event.ports[0];
if (callback(event.data, port) && port)
port.postMessage("");
}
window.addEventListener("message", onMessage, false);
}
InspectorTest.runExtensionTests = function()
{
function addExtension(callback)
{
InjectedScriptAccess.getDefault().evaluate("location.href", "console", function(result) {
var extensionURL = result.description.replace(/\/[^/]*$/, "/resources/extension-main.html");
WebInspector.addExtensions([{ startPage: extensionURL }]);
if (callback)
callback();
});
}
InspectorTest.dispatchOnMessage("extension-tests-done", function() {
InspectorTest.completeTest();
InjectedScriptAccess.getDefault().evaluate("location.href", "console", function(result) {
var extensionURL = result.description.replace(/\/[^/]*$/, "/resources/extension-main.html");
WebInspector.addExtensions([{ startPage: extensionURL }]);
});
InspectorTest.reloadPageIfNeeded(addExtension);
}
InspectorTest.dumpSidebarContent = function()
InspectorTest.dispatchOnMessage("extension-tests-done", InspectorTest.completeTest, true);
function extensionOutput(message)
{
InspectorTest.addResult(message.text);
}
InspectorTest.dispatchOnMessage("output", extensionOutput, true);
function dumpSidebarContent()
{
var sidebarPanes = WebInspector.panels.scripts.sidebarPanes;
var sidebarPanes = WebInspector.panels.elements.sidebarPanes;
// the sidebar of interest is presumed to always be last.
var sidebar = sidebarPanes[Object.keys(sidebarPanes).pop()];
InspectorTest.addResult("Sidebar content: " + sidebar.bodyElement.textContent);
return true;
}
InspectorTest.dispatchOnMessage("dump-sidebar-content", dumpSidebarContent, true);
InspectorTest.dispatchOnMessage("dump-sidebar-content", InspectorTest.dumpSidebarContent, true);
function reloadPage(data, port)
{