summaryrefslogtreecommitdiff
path: root/Tools/TestWebKitAPI/PlatformUtilities.h
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
commit1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch)
tree46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Tools/TestWebKitAPI/PlatformUtilities.h
parent32761a6cee1d0dee366b885b7b9c777e67885688 (diff)
downloadWebKitGtk-tarball-master.tar.gz
Diffstat (limited to 'Tools/TestWebKitAPI/PlatformUtilities.h')
-rw-r--r--Tools/TestWebKitAPI/PlatformUtilities.h33
1 files changed, 19 insertions, 14 deletions
diff --git a/Tools/TestWebKitAPI/PlatformUtilities.h b/Tools/TestWebKitAPI/PlatformUtilities.h
index 10da84d33..86ddcfa57 100644
--- a/Tools/TestWebKitAPI/PlatformUtilities.h
+++ b/Tools/TestWebKitAPI/PlatformUtilities.h
@@ -26,15 +26,16 @@
#ifndef PlatformUtilities_h
#define PlatformUtilities_h
-#include <WebKit2/WKRetainPtr.h>
+#ifndef BUILDING_JSCONLY__
+#include <WebKit/WKNativeEvent.h>
+#include <WebKit/WKRetainPtr.h>
+#endif
+
+#include "Utilities.h"
#include <string>
-#if PLATFORM(MAC)
-#if __OBJC__
-@class NSString;
-#else
-class NSString;
-#endif
+#if USE(FOUNDATION)
+OBJC_CLASS NSString;
#endif
namespace TestWebKitAPI {
@@ -42,12 +43,14 @@ namespace Util {
// Runs a platform runloop until the 'done' is true.
void run(bool* done);
+void sleep(double seconds);
-#if PLATFORM(WIN)
-bool shouldTranslateMessage(const MSG&);
+std::string toSTD(const char*);
+#if USE(FOUNDATION)
+std::string toSTD(NSString *);
#endif
-void sleep(double seconds);
+#if WK_HAVE_C_SPI
WKContextRef createContextWithInjectedBundle();
WKContextRef createContextForInjectedBundleTest(const std::string&, WKTypeRef userData = 0);
@@ -62,13 +65,11 @@ bool isKeyDown(WKNativeEventPtr);
std::string toSTD(WKStringRef);
std::string toSTD(WKRetainPtr<WKStringRef>);
-std::string toSTD(const char*);
-#if PLATFORM(MAC)
-std::string toSTD(NSString *);
-#endif
WKRetainPtr<WKStringRef> toWK(const char* utf8String);
+#endif // WK_HAVE_C_SPI
+
template<typename T, typename U>
static inline ::testing::AssertionResult assertWKStringEqual(const char* expected_expression, const char* actual_expression, T expected, U actual)
{
@@ -78,6 +79,10 @@ static inline ::testing::AssertionResult assertWKStringEqual(const char* expecte
#define EXPECT_WK_STREQ(expected, actual) \
EXPECT_PRED_FORMAT2(TestWebKitAPI::Util::assertWKStringEqual, expected, actual)
+#if WK_API_ENABLED
+extern NSString * const TestPlugInClassNameParameter;
+#endif
+
} // namespace Util
} // namespace TestWebKitAPI