Web Inspector: [Extensions API] expose ExtensionServerClient to tests so tests use same port as extensions API
https://bugs.webkit.org/show_bug.cgi?id=109443

Reviewed by Vsevolod Vlasov.

Source/WebCore:

Promote extensionServer var to the outer closure, so it may be accessed by platform-specific (or test) code.

* inspector/front-end/ExtensionAPI.js:
(buildExtensionAPIInjectedScript):

LayoutTests:

- replace additional message ports used for evaluating code in front-end with normal extension transport.

* http/tests/inspector/extensions-test.js:
(initialize_ExtensionsTest.window.buildPlatformExtensionAPI):
(initialize_ExtensionsTest.InspectorTest._replyToExtension):
(initialize_ExtensionsTest.onEvaluate):
* http/tests/inspector/resources/extension-main.js:
* inspector/extensions/extensions-audits.html:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: [Extension API] adjust inspectedWindow.eval() callback parameters to expose non-exceptional error
https://bugs.webkit.org/show_bug.cgi?id=108640

Reviewed by Vsevolod Vlasov.

Source/WebCore:

- only set first parameter to eval() callback iff expression successfully evaluates;
- use object, not bool as second parameter;
- pass exceptions and extension errors as second parameter if evaluate failed;
- minor drive-by changes in ExtensionAPI utilities.

* inspector/front-end/ExtensionAPI.js:
(injectedExtensionAPI.ExtensionSidebarPaneImpl.prototype.setExpression):
(injectedExtensionAPI.InspectedWindow.prototype.):
(injectedExtensionAPI.InspectedWindow.prototype.eval):
(injectedExtensionAPI.extractCallbackArgument):
* inspector/front-end/ExtensionServer.js:
(WebInspector.ExtensionServer.prototype.):
(WebInspector.ExtensionServer.prototype._onEvaluateOnInspectedPage):
(WebInspector.ExtensionStatus):

LayoutTests:

Rebase tests following change in exception parameter to inspectedWindow.eval() callback.

* inspector/extensions/extensions-eval-expected.txt:
* inspector/extensions/extensions-eval.html:
* inspector/extensions/extensions-sidebar-expected.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142486 268f45cc-cd09-0410-ab3c-d52691b4dbfc