[Mac] Add tests for secure event input
[WebKit-https.git] / Tools / WebKitTestRunner / TestInvocation.cpp
index 253c7c7..715dca4 100644 (file)
@@ -43,6 +43,7 @@
 #include <wtf/text/CString.h>
 
 #if PLATFORM(MAC)
+#include <Carbon/Carbon.h>
 #include <WebKit2/WKPagePrivateMac.h>
 #endif
 
@@ -663,6 +664,14 @@ WKRetainPtr<WKTypeRef> TestInvocation::didReceiveSynchronousMessageFromInjectedB
         return result;
     }
 
+    if (WKStringIsEqualToUTF8CString(messageName, "SecureEventInputIsEnabled")) {
+#if PLATFORM(MAC)
+        WKRetainPtr<WKBooleanRef> result(AdoptWK, WKBooleanCreate(IsSecureEventInputEnabled()));
+#else
+        WKRetainPtr<WKBooleanRef> result(AdoptWK, WKBooleanCreate(false);
+#endif
+        return result;
+    }
     ASSERT_NOT_REACHED();
     return 0;
 }