[GTK] Build and run TestWebKitAPI WebKit2 unit tests
authorcarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 Apr 2012 14:47:39 +0000 (14:47 +0000)
committercarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 Apr 2012 14:47:39 +0000 (14:47 +0000)
commite548b5cd75a8cda9a78c62a34a18d727ba88c476
tree4faeab33f5980c4b0a6df37caf854ddcd8c5b24d
parentb53fe323b7eae980dcf2ab8f4287aade3a4518c0
[GTK] Build and run TestWebKitAPI WebKit2 unit tests
https://bugs.webkit.org/show_bug.cgi?id=84446

Reviewed by Philippe Normand.

Source/ThirdParty:

* gtest/GNUmakefile.am: Do not build libgtestmain anymmore since
all tests use now a custom main to make sure WTF threads are
initialized.

Source/WebKit2:

* UIProcess/API/C/WKNativeEvent.h: Define WKNativeEventPtr as
GdkEvent for the GTK+ port.

Tools:

* Scripts/run-gtk-tests:
(TestRunner): Add TestWebKitAPI/WebKit2 to the list of directories
containing tests. Unskip FunctionalTest.RefCountedStorage, since
we are now using a custom main that initializes WTF threading.
(TestRunner._setup_testing_environment): Set environment variables
required to run WebKit2 tests.
* TestWebKitAPI/GNUmakefile.am:
* TestWebKitAPI/JavaScriptTest.cpp: Use
JavaScriptCore/JSContextRef.h instead of
JavaScriptCore/JavaScriptCore.h since it includes JSStringRefCF.h
unconditionally.
* TestWebKitAPI/PlatformWebView.h: Define PlatformWKView and
PlatformWindow for GTK.
* TestWebKitAPI/Tests/WebKit2/EvaluateJavaScript.cpp: Remove
unneded header that breaks the build of GTK port.
* TestWebKitAPI/Tests/WebKit2/PreventEmptyUserAgent.cpp: Use
JavaScriptCore/JSContextRef.h instead of
JavaScriptCore/JavaScriptCore.h since it includes JSStringRefCF.h
unconditionally.
* TestWebKitAPI/Tests/WebKit2/WKPreferences.cpp:
(TestWebKitAPI::TEST): Add expected values for GTK+ port.
* TestWebKitAPI/gtk/InjectedBundleControllerGtk.cpp:
(TestWebKitAPI):
(TestWebKitAPI::InjectedBundleController::platformInitialize):
* TestWebKitAPI/gtk/PlatformUtilitiesGtk.cpp: Added.
(TestWebKitAPI::Util::checkTestFinished):
(TestWebKitAPI::Util::run):
(TestWebKitAPI::Util::sleep):
(TestWebKitAPI::Util::getFilenameFromEnvironmentVariableAsUTF8):
(TestWebKitAPI::Util::createInjectedBundlePath):
(TestWebKitAPI::Util::createURLForResource):
(TestWebKitAPI::Util::URLForNonExistentResource):
(TestWebKitAPI::Util::isKeyDown):
* TestWebKitAPI/gtk/PlatformWebViewGtk.cpp: Added.
(TestWebKitAPI::PlatformWebView::PlatformWebView):
(TestWebKitAPI::PlatformWebView::~PlatformWebView):
(TestWebKitAPI::PlatformWebView::page):
(TestWebKitAPI::PlatformWebView::resizeTo):
(TestWebKitAPI::doKeyStroke):
(TestWebKitAPI::PlatformWebView::simulateSpacebarKeyPress):
(TestWebKitAPI::PlatformWebView::simulateAltKeyPress):
(TestWebKitAPI::doMouseButtonEvent):
(TestWebKitAPI::PlatformWebView::simulateRightClick):
(TestWebKitAPI::PlatformWebView::simulateMouseMove):
* TestWebKitAPI/gtk/main.cpp:
(main):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@115314 268f45cc-cd09-0410-ab3c-d52691b4dbfc
16 files changed:
Source/ThirdParty/ChangeLog
Source/ThirdParty/gtest/GNUmakefile.am
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/C/WKNativeEvent.h
Tools/ChangeLog
Tools/Scripts/run-gtk-tests
Tools/TestWebKitAPI/GNUmakefile.am
Tools/TestWebKitAPI/JavaScriptTest.cpp
Tools/TestWebKitAPI/PlatformWebView.h
Tools/TestWebKitAPI/Tests/WebKit2/EvaluateJavaScript.cpp
Tools/TestWebKitAPI/Tests/WebKit2/PreventEmptyUserAgent.cpp
Tools/TestWebKitAPI/Tests/WebKit2/WKPreferences.cpp
Tools/TestWebKitAPI/gtk/InjectedBundleControllerGtk.cpp [new file with mode: 0644]
Tools/TestWebKitAPI/gtk/PlatformUtilitiesGtk.cpp [new file with mode: 0644]
Tools/TestWebKitAPI/gtk/PlatformWebViewGtk.cpp [new file with mode: 0644]
Tools/TestWebKitAPI/gtk/main.cpp [new file with mode: 0644]