summaryrefslogtreecommitdiff
path: root/Tools/TestWebKitAPI/Tests/WebKit2/DidAssociateFormControls_Bundle.cpp
diff options
context:
space:
mode:
authorKonstantin Tokarev <annulen@yandex.ru>2016-08-25 19:20:41 +0300
committerKonstantin Tokarev <annulen@yandex.ru>2017-02-02 12:30:55 +0000
commit6882a04fb36642862b11efe514251d32070c3d65 (patch)
treeb7959826000b061fd5ccc7512035c7478742f7b0 /Tools/TestWebKitAPI/Tests/WebKit2/DidAssociateFormControls_Bundle.cpp
parentab6df191029eeeb0b0f16f127d553265659f739e (diff)
downloadqtwebkit-6882a04fb36642862b11efe514251d32070c3d65.tar.gz
Imported QtWebKit TP3 (git b57bc6801f1876c3220d5a4bfea33d620d477443)
Change-Id: I3b1d8a2808782c9f34d50240000e20cb38d3680f Reviewed-by: Konstantin Tokarev <annulen@yandex.ru>
Diffstat (limited to 'Tools/TestWebKitAPI/Tests/WebKit2/DidAssociateFormControls_Bundle.cpp')
-rw-r--r--Tools/TestWebKitAPI/Tests/WebKit2/DidAssociateFormControls_Bundle.cpp25
1 files changed, 15 insertions, 10 deletions
diff --git a/Tools/TestWebKitAPI/Tests/WebKit2/DidAssociateFormControls_Bundle.cpp b/Tools/TestWebKitAPI/Tests/WebKit2/DidAssociateFormControls_Bundle.cpp
index b742650af..5dcd91da8 100644
--- a/Tools/TestWebKitAPI/Tests/WebKit2/DidAssociateFormControls_Bundle.cpp
+++ b/Tools/TestWebKitAPI/Tests/WebKit2/DidAssociateFormControls_Bundle.cpp
@@ -24,11 +24,14 @@
*/
#include "config.h"
+
+#if WK_HAVE_C_SPI
+
#include "InjectedBundleTest.h"
#include "PlatformUtilities.h"
-#include <WebKit2/WKBundle.h>
-#include <WebKit2/WKBundlePage.h>
+#include <WebKit/WKBundle.h>
+#include <WebKit/WKBundlePage.h>
namespace TestWebKitAPI {
@@ -36,7 +39,7 @@ class DidAssociateFormControlsTest : public InjectedBundleTest {
public:
DidAssociateFormControlsTest(const std::string& identifier);
- virtual void didCreatePage(WKBundleRef, WKBundlePageRef) OVERRIDE;
+ virtual void didCreatePage(WKBundleRef, WKBundlePageRef) override;
};
static InjectedBundleTest::Register<DidAssociateFormControlsTest> registrar("DidAssociateFormControlsTest");
@@ -50,11 +53,11 @@ static void didAssociateFormControls(WKBundlePageRef page, WKArrayRef elementHan
{
WKRetainPtr<WKMutableDictionaryRef> messageBody = adoptWK(WKMutableDictionaryCreate());
- WKDictionaryAddItem(messageBody.get(), Util::toWK("Page").get(), page);
+ WKDictionarySetItem(messageBody.get(), Util::toWK("Page").get(), page);
WKRetainPtr<WKUInt64Ref> numberOfElements = adoptWK(WKUInt64Create(WKArrayGetSize(elementHandles)));
- WKDictionaryAddItem(messageBody.get(), Util::toWK("NumberOfControls").get(), numberOfElements.get());
+ WKDictionarySetItem(messageBody.get(), Util::toWK("NumberOfControls").get(), numberOfElements.get());
- WKBundlePostMessage(InjectedBundleController::shared().bundle(), Util::toWK("DidReceiveDidAssociateFormControls").get(), messageBody.get());
+ WKBundlePostMessage(InjectedBundleController::singleton().bundle(), Util::toWK("DidReceiveDidAssociateFormControls").get(), messageBody.get());
}
DidAssociateFormControlsTest::DidAssociateFormControlsTest(const std::string& identifier)
@@ -64,15 +67,17 @@ DidAssociateFormControlsTest::DidAssociateFormControlsTest(const std::string& id
void DidAssociateFormControlsTest::didCreatePage(WKBundleRef bundle, WKBundlePageRef page)
{
- WKBundlePageFormClient formClient;
+ WKBundlePageFormClientV2 formClient;
memset(&formClient, 0, sizeof(formClient));
- formClient.version = 2;
- formClient.clientInfo = this;
+ formClient.base.version = 2;
+ formClient.base.clientInfo = this;
formClient.shouldNotifyOnFormChanges = shouldNotifyOnFormChanges;
formClient.didAssociateFormControls = didAssociateFormControls;
- WKBundlePageSetFormClient(page, &formClient);
+ WKBundlePageSetFormClient(page, &formClient.base);
}
} // namespace TestWebKitAPI
+
+#endif