[WPE] Add a MiniBrowser and use it to run WebDriver tests
authorcarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 11 Jun 2018 06:43:14 +0000 (06:43 +0000)
committercarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 11 Jun 2018 06:43:14 +0000 (06:43 +0000)
commitcc490cd3dd5e47a268946c3cb2e4548e73fea248
tree72f7bae2b06695eb102674fc32bfcb5b754cd260
parenta0e8c21a3287730f43e3245ebbd33c4b16842a6e
[WPE] Add a MiniBrowser and use it to run WebDriver tests
https://bugs.webkit.org/show_bug.cgi?id=186345

Reviewed by Žan Doberšek.

.:

Add an option to enable building the MiniBrowser.

* Source/cmake/FindWaylandProtocols.cmake: Added.
* Source/cmake/OptionsWPE.cmake:

Source/WebDriver:

Use MiniBrowser instead of dyz as the default WebDriver browser for WPE.

* wpe/WebDriverServiceWPE.cpp:
(WebDriver::WebDriverService::platformParseCapabilities const):

Tools:

Most of the code is based on dyz and gtk MiniBrowser. This patch adds a new internal library WPEToolingBackends,
including the headless view backend and a new window backend to be used by the MiniBrowser. MiniBrowser can also
run in headless mode, by using the headless backend instead of the window one, which will allow us to run the
WebDriver tests in the bots.

* CMakeLists.txt:
* MiniBrowser/wpe/CMakeLists.txt: Added.
* MiniBrowser/wpe/main.cpp: Added.
(automationStartedCallback):
(createViewBackend):
(main):
* Scripts/run-minibrowser: Remove WPE specific code.
* Scripts/run-webdriver-tests: Add headless display-server option.
* Scripts/webkitdirs.pm:
(launcherName): Remove WPE specific code.
* Scripts/webkitpy/webdriver_tests/webdriver_driver_wpe.py:
(WebDriverWPE.browser_name): Return MiniBrowser.
(WebDriverWPE.browser_path): Return the path to the MiniBrowser in build dir.
(WebDriverWPE.browser_args): Add --headless when running in headless mode.
(WebDriverWPE.capabilities): Use the full browser path.
* Scripts/webkitpy/webdriver_tests/webdriver_test_runner_selenium.py:
(WebDriverTestRunnerSelenium.collect_tests): Fix early return value.
* TestWebKitAPI/PlatformWPE.cmake: Use WPEToolingBackends instead of HeadlessViewBackend.
* TestWebKitAPI/PlatformWebView.h: Ditto.
* TestWebKitAPI/glib/PlatformWPE.cmake: Ditto
* TestWebKitAPI/glib/WebKitGLib/TestMain.h:
(Test::createWebViewBackend): Ditto.
* TestWebKitAPI/wpe/PlatformWebViewWPE.cpp:
(TestWebKitAPI::PlatformWebView::initialize): Ditto.
* WebKitTestRunner/PlatformWPE.cmake: Ditto.
* WebKitTestRunner/PlatformWebView.h: Ditto.
* WebKitTestRunner/wpe/PlatformWebViewWPE.cpp:
(WTR::PlatformWebView::PlatformWebView): Ditto.
* wpe/HeadlessViewBackend/CMakeLists.txt: Removed.
* wpe/backends/CMakeLists.txt: Added.
* wpe/backends/HeadlessViewBackend.cpp: Renamed from Tools/wpe/HeadlessViewBackend/HeadlessViewBackend.cpp.
(WPEToolingBackends::getEGLDisplay):
(WPEToolingBackends::HeadlessViewBackend::HeadlessViewBackend):
(WPEToolingBackends::HeadlessViewBackend::~HeadlessViewBackend):
(WPEToolingBackends::HeadlessViewBackend::createSnapshot):
(WPEToolingBackends::HeadlessViewBackend::performUpdate):
(WPEToolingBackends::HeadlessViewBackend::displayBuffer):
* wpe/backends/HeadlessViewBackend.h: Renamed from Tools/wpe/HeadlessViewBackend/HeadlessViewBackend.h.
* wpe/backends/ViewBackend.cpp: Added.
(WPEToolingBackends::ViewBackend::ViewBackend):
(WPEToolingBackends::ViewBackend::~ViewBackend):
(WPEToolingBackends::ViewBackend::initialize):
(WPEToolingBackends::ViewBackend::setInputClient):
(WPEToolingBackends::ViewBackend::backend const):
(WPEToolingBackends::ViewBackend::dispatchInputPointerEvent):
(WPEToolingBackends::ViewBackend::dispatchInputAxisEvent):
(WPEToolingBackends::ViewBackend::dispatchInputKeyboardEvent):
* wpe/backends/ViewBackend.h: Added.
* wpe/backends/WindowViewBackend.cpp: Added.
(WPEToolingBackends::WindowViewBackend::WindowViewBackend):
(WPEToolingBackends::WindowViewBackend::~WindowViewBackend):
(WPEToolingBackends::WindowViewBackend::displayBuffer):
(WPEToolingBackends::WindowViewBackend::handleKeyEvent):
* wpe/backends/WindowViewBackend.h: Added.
* wpe/jhbuild.modules: Remove dyz and add wayland-protocols.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@232670 268f45cc-cd09-0410-ab3c-d52691b4dbfc
31 files changed:
ChangeLog
Source/WebDriver/ChangeLog
Source/WebDriver/wpe/WebDriverServiceWPE.cpp
Source/cmake/FindWaylandProtocols.cmake [new file with mode: 0644]
Source/cmake/OptionsWPE.cmake
Tools/CMakeLists.txt
Tools/ChangeLog
Tools/MiniBrowser/wpe/CMakeLists.txt [new file with mode: 0644]
Tools/MiniBrowser/wpe/main.cpp [new file with mode: 0644]
Tools/Scripts/run-minibrowser
Tools/Scripts/run-webdriver-tests
Tools/Scripts/webkitdirs.pm
Tools/Scripts/webkitpy/webdriver_tests/webdriver_driver_wpe.py
Tools/Scripts/webkitpy/webdriver_tests/webdriver_test_runner_selenium.py
Tools/TestWebKitAPI/PlatformWPE.cmake
Tools/TestWebKitAPI/PlatformWebView.h
Tools/TestWebKitAPI/glib/PlatformWPE.cmake
Tools/TestWebKitAPI/glib/WebKitGLib/TestMain.h
Tools/TestWebKitAPI/wpe/PlatformWebViewWPE.cpp
Tools/WebKitTestRunner/PlatformWPE.cmake
Tools/WebKitTestRunner/PlatformWebView.h
Tools/WebKitTestRunner/wpe/PlatformWebViewWPE.cpp
Tools/wpe/HeadlessViewBackend/CMakeLists.txt [deleted file]
Tools/wpe/backends/CMakeLists.txt [new file with mode: 0644]
Tools/wpe/backends/HeadlessViewBackend.cpp [moved from Tools/wpe/HeadlessViewBackend/HeadlessViewBackend.cpp with 57% similarity]
Tools/wpe/backends/HeadlessViewBackend.h [moved from Tools/wpe/HeadlessViewBackend/HeadlessViewBackend.h with 61% similarity]
Tools/wpe/backends/ViewBackend.cpp [new file with mode: 0644]
Tools/wpe/backends/ViewBackend.h [new file with mode: 0644]
Tools/wpe/backends/WindowViewBackend.cpp [new file with mode: 0644]
Tools/wpe/backends/WindowViewBackend.h [new file with mode: 0644]
Tools/wpe/jhbuild.modules