[WK2][WTR] LayoutTestController.sendWebIntentResponse() needs to be implemented
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 Jul 2012 20:34:28 +0000 (20:34 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 Jul 2012 20:34:28 +0000 (20:34 +0000)
commit0b99f15127c9d652b64863f1652ab5e635a9e6cf
treec1ccb71badf05d8dc7a9f79b992d27374edbfd81
parentc7572a613d2fb7007b175025b93dbad4a9be0c87
[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: https://svn.webkit.org/repository/webkit/trunk@123652 268f45cc-cd09-0410-ab3c-d52691b4dbfc
23 files changed:
Source/WebKit2/CMakeLists.txt
Source/WebKit2/ChangeLog
Source/WebKit2/GNUmakefile.list.am
Source/WebKit2/Shared/API/c/WKBase.h
Source/WebKit2/Shared/APIObject.h
Source/WebKit2/Shared/IntentData.cpp
Source/WebKit2/Shared/IntentData.h
Source/WebKit2/Target.pri
Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleAPICast.h
Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleIntentRequest.cpp [new file with mode: 0644]
Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleIntentRequest.h [new file with mode: 0644]
Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h
Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleIntentRequest.cpp [new file with mode: 0644]
Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleIntentRequest.h [new file with mode: 0644]
Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp
Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h
Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
Tools/ChangeLog
Tools/WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl
Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h
Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp
Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.h