From 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c Mon Sep 17 00:00:00 2001 From: Lorry Tar Creator Date: Tue, 27 Jun 2017 06:07:23 +0000 Subject: webkitgtk-2.16.5 --- Tools/TestWebKitAPI/PlatformUtilities.h | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) (limited to 'Tools/TestWebKitAPI/PlatformUtilities.h') 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 +#ifndef BUILDING_JSCONLY__ +#include +#include +#endif + +#include "Utilities.h" #include -#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); -std::string toSTD(const char*); -#if PLATFORM(MAC) -std::string toSTD(NSString *); -#endif WKRetainPtr toWK(const char* utf8String); +#endif // WK_HAVE_C_SPI + template 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 -- cgit v1.2.1