summaryrefslogtreecommitdiff
path: root/Tools/TestWebKitAPI/PlatformUtilities.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Tools/TestWebKitAPI/PlatformUtilities.cpp')
-rw-r--r--Tools/TestWebKitAPI/PlatformUtilities.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/Tools/TestWebKitAPI/PlatformUtilities.cpp b/Tools/TestWebKitAPI/PlatformUtilities.cpp
index cebff7be9..216c70ac2 100644
--- a/Tools/TestWebKitAPI/PlatformUtilities.cpp
+++ b/Tools/TestWebKitAPI/PlatformUtilities.cpp
@@ -24,6 +24,7 @@
*/
#include "config.h"
+
#include "PlatformUtilities.h"
#include <wtf/StdLibExtras.h>
@@ -31,6 +32,8 @@
namespace TestWebKitAPI {
namespace Util {
+#if WK_HAVE_C_SPI
+
WKContextRef createContextWithInjectedBundle()
{
WKRetainPtr<WKStringRef> injectedBundlePath(AdoptWK, createInjectedBundlePath());
@@ -76,14 +79,16 @@ std::string toSTD(WKRetainPtr<WKStringRef> string)
return toSTD(string.get());
}
-std::string toSTD(const char* string)
+WKRetainPtr<WKStringRef> toWK(const char* utf8String)
{
- return std::string(string);
+ return WKRetainPtr<WKStringRef>(AdoptWK, WKStringCreateWithUTF8CString(utf8String));
}
-WKRetainPtr<WKStringRef> toWK(const char* utf8String)
+#endif // WK_HAVE_C_SPI
+
+std::string toSTD(const char* string)
{
- return WKRetainPtr<WKStringRef>(AdoptWK, WKStringCreateWithUTF8CString(utf8String));
+ return std::string(string);
}
} // namespace Util