[WK2][WTR] LayoutTestController.sendWebIntentResponse() needs to be implemented
https://bugs.webkit.org/show_bug.cgi?id=92227

Patch by Christophe Dumez <christophe.dumez@intel.com> on 2012-07-25
Reviewed by Kenneth Rohde Christiansen.

Source/WebKit2:

Add new InjectedBundleIntentRequest class to wrap WebCore's
IntentRequest and use it in InjectedBundle's
didReceiveIntentForFrame callback. The WebKitTestRunner needs
to be able to reply to a Web intent request in order to
implement LayoutTestController.sendWebIntentResponse(). As
a consequence, passing a WebIntentData type in not enough.

* CMakeLists.txt:
* GNUmakefile.list.am:
* Shared/API/c/WKBase.h:
* Shared/APIObject.h:
* Shared/IntentData.cpp:
(WebKit::IntentData::IntentData):
(WebKit):
* Shared/IntentData.h:
(WebCore):
(WebKit::IntentData::IntentData):
(IntentData):
* Target.pri:
* WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
(WebKit):
* WebProcess/InjectedBundle/API/c/WKBundleIntentRequest.cpp: Copied from Source/WebKit2/Shared/IntentData.cpp.
(WKBundleIntentRequestGetTypeID):
(WKBundleIntentRequestCopyIntent):
(WKBundleIntentRequestPostResult):
(WKBundleIntentRequestPostFailure):
* WebProcess/InjectedBundle/API/c/WKBundleIntentRequest.h: Copied from Source/WebKit2/Shared/IntentData.h.
* WebProcess/InjectedBundle/API/c/WKBundlePage.h:
* WebProcess/InjectedBundle/InjectedBundleIntentRequest.cpp: Copied from Source/WebKit2/Shared/IntentData.cpp.
(WebKit):
(WebKit::InjectedBundleIntentRequest::create):
(WebKit::InjectedBundleIntentRequest::InjectedBundleIntentRequest):
(WebKit::InjectedBundleIntentRequest::postResult):
(WebKit::InjectedBundleIntentRequest::postFailure):
(WebKit::InjectedBundleIntentRequest::intent):
* WebProcess/InjectedBundle/InjectedBundleIntentRequest.h: Copied from Source/WebKit2/Shared/IntentData.h.
(WebCore):
(WebKit):
(InjectedBundleIntentRequest):
(WebKit::InjectedBundleIntentRequest::type):
* WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
(WebKit::InjectedBundlePageLoaderClient::didReceiveIntentForFrame):
* WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
(WebKit):
(InjectedBundlePageLoaderClient):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchIntent):

Tools:

Implement LayoutTestController.sendWebIntentResponse() so
that a test case can reply to a Web intent request and
test this functionality.

In order to support this functionality, we need to keep
a pointer to the current intent request in
InjectedBundlePage::didReceiveIntentForFrame() so that
we can reuse it later in
LayoutTestController::sendWebIntentResponse().

The following tests need this functionality:
- webintents/web-intents-failure.html
- webintents/web-intents-reply.html

* WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl:
* WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
(WTR::InjectedBundlePage::didReceiveIntentForFrame):
* WebKitTestRunner/InjectedBundle/InjectedBundlePage.h:
(InjectedBundlePage):
(WTR::InjectedBundlePage::currentIntentRequest):
* WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
(WTR::LayoutTestController::sendWebIntentResponse):
(WTR):
* WebKitTestRunner/InjectedBundle/LayoutTestController.h:
(LayoutTestController):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123652 268f45cc-cd09-0410-ab3c-d52691b4dbfc
23 files changed