diff options
| author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2016-05-24 08:28:08 +0000 |
|---|---|---|
| committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2016-05-24 08:28:08 +0000 |
| commit | a4e969f4965059196ca948db781e52f7cfebf19e (patch) | |
| tree | 6ca352808c8fdc52006a0f33f6ae3c593b23867d /Tools/TestWebKitAPI/Tests/WebKit2/RestoreSessionStateContainingFormData.cpp | |
| parent | 41386e9cb918eed93b3f13648cbef387e371e451 (diff) | |
| download | WebKitGtk-tarball-a4e969f4965059196ca948db781e52f7cfebf19e.tar.gz | |
webkitgtk-2.12.3webkitgtk-2.12.3
Diffstat (limited to 'Tools/TestWebKitAPI/Tests/WebKit2/RestoreSessionStateContainingFormData.cpp')
| -rw-r--r-- | Tools/TestWebKitAPI/Tests/WebKit2/RestoreSessionStateContainingFormData.cpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/Tools/TestWebKitAPI/Tests/WebKit2/RestoreSessionStateContainingFormData.cpp b/Tools/TestWebKitAPI/Tests/WebKit2/RestoreSessionStateContainingFormData.cpp index 079c51856..b16537e70 100644 --- a/Tools/TestWebKitAPI/Tests/WebKit2/RestoreSessionStateContainingFormData.cpp +++ b/Tools/TestWebKitAPI/Tests/WebKit2/RestoreSessionStateContainingFormData.cpp @@ -24,10 +24,14 @@ */ #include "config.h" + +#if WK_HAVE_C_SPI + #include "JavaScriptTest.h" #include "PlatformUtilities.h" #include "PlatformWebView.h" #include "Test.h" +#include <WebKit/WKSessionStateRef.h> namespace TestWebKitAPI { @@ -49,7 +53,7 @@ static void setPageLoaderClient(WKPageRef page) WKPageSetPageLoaderClient(page, &loaderClient.base); } -static WKRetainPtr<WKDataRef> createSessionStateContainingFormData(WKContextRef context) +static WKRetainPtr<WKDataRef> createSessionStateDataContainingFormData(WKContextRef context) { PlatformWebView webView(context); setPageLoaderClient(webView.page()); @@ -62,7 +66,8 @@ static WKRetainPtr<WKDataRef> createSessionStateContainingFormData(WKContextRef Util::run(&didFinishLoad); didFinishLoad = false; - return adoptWK(WKPageCopySessionState(webView.page(), 0, 0)); + auto sessionState = adoptWK(static_cast<WKSessionStateRef>(WKPageCopySessionState(webView.page(), reinterpret_cast<void*>(1), nullptr))); + return adoptWK(WKSessionStateCopyData(sessionState.get())); } TEST(WebKit2, RestoreSessionStateContainingFormData) @@ -75,13 +80,17 @@ TEST(WebKit2, RestoreSessionStateContainingFormData) PlatformWebView webView(context.get()); setPageLoaderClient(webView.page()); - WKRetainPtr<WKDataRef> data = createSessionStateContainingFormData(context.get()); + WKRetainPtr<WKDataRef> data = createSessionStateDataContainingFormData(context.get()); EXPECT_NOT_NULL(data); - WKPageRestoreFromSessionState(webView.page(), data.get()); + auto sessionState = adoptWK(WKSessionStateCreateFromData(data.get())); + WKPageRestoreFromSessionState(webView.page(), sessionState.get()); + Util::run(&didFinishLoad); EXPECT_TRUE(WKPageCanGoBack(webView.page())); } } // namespace TestWebKitAPI + +#endif |
