- Revision
- 161857
- Author
- [email protected]
- Date
- 2014-01-12 20:09:39 -0800 (Sun, 12 Jan 2014)
Log Message
[EFL][WK2] Make API tests work again
https://bugs.webkit.org/show_bug.cgi?id=126769
Patch by Sergio Correia <[email protected]> on 2014-01-12
Reviewed by Gyuyoung Kim.
The EFL and WK2 test binaries are currently being generated at *TestWebKitAPI/
[E]WebKit2, respectively, and this causes problems because the logic to find
where WebProcess is to look in the same directory of the running process and
then proceed to use LIBEXECDIR (typically /usr/loca/bin).
This patch introduces a WEBKIT_EXEC_PATH environment variable, inspired in the
Gtk port, which allows us to look for WebProcess initially in this directory,
if it's defined.
.:
* Source/cmake/OptionsEfl.cmake: Define WEBKIT_EXEC_PATH, to be used by
[E]WebKit2 tests.
Source/WebKit2:
* Shared/efl/ProcessExecutablePathEfl.cpp:
(WebKit::findProcessPath): Change the logic to look initially in
WEBKIT_EXEC_PATH, then proceed with the existing checks.
* UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestEnvironment.cpp:
(EWK2UnitTest::EWK2UnitTestEnvironment::EWK2UnitTestEnvironment):
Define WEBKIT_EXEC_PATH to be used by EWebKit2 tests.
Tools:
* TestWebKitAPI/efl/main.cpp:
(main): Define WEBKIT_EXEC_PATH to be used by WebKit2 API tests.
Modified Paths
Diff
Modified: trunk/ChangeLog (161856 => 161857)
--- trunk/ChangeLog 2014-01-13 04:03:56 UTC (rev 161856)
+++ trunk/ChangeLog 2014-01-13 04:09:39 UTC (rev 161857)
@@ -1,3 +1,22 @@
+2014-01-12 Sergio Correia <[email protected]>
+
+ [EFL][WK2] Make API tests work again
+ https://bugs.webkit.org/show_bug.cgi?id=126769
+
+ Reviewed by Gyuyoung Kim.
+
+ The EFL and WK2 test binaries are currently being generated at *TestWebKitAPI/
+ [E]WebKit2, respectively, and this causes problems because the logic to find
+ where WebProcess is to look in the same directory of the running process and
+ then proceed to use LIBEXECDIR (typically /usr/loca/bin).
+
+ This patch introduces a WEBKIT_EXEC_PATH environment variable, inspired in the
+ Gtk port, which allows us to look for WebProcess initially in this directory,
+ if it's defined.
+
+ * Source/cmake/OptionsEfl.cmake: Define WEBKIT_EXEC_PATH, to be used by
+ [E]WebKit2 tests.
+
2014-01-11 Dan Bernstein <[email protected]>
[Mac] xcodebuild color output is suppressed when using make
Modified: trunk/Source/WebKit2/ChangeLog (161856 => 161857)
--- trunk/Source/WebKit2/ChangeLog 2014-01-13 04:03:56 UTC (rev 161856)
+++ trunk/Source/WebKit2/ChangeLog 2014-01-13 04:09:39 UTC (rev 161857)
@@ -1,3 +1,26 @@
+2014-01-12 Sergio Correia <[email protected]>
+
+ [EFL][WK2] Make API tests work again
+ https://bugs.webkit.org/show_bug.cgi?id=126769
+
+ Reviewed by Gyuyoung Kim.
+
+ The EFL and WK2 test binaries are currently being generated at *TestWebKitAPI/
+ [E]WebKit2, respectively, and this causes problems because the logic to find
+ where WebProcess is to look in the same directory of the running process and
+ then proceed to use LIBEXECDIR (typically /usr/loca/bin).
+
+ This patch introduces a WEBKIT_EXEC_PATH environment variable, inspired in the
+ Gtk port, which allows us to look for WebProcess initially in this directory,
+ if it's defined.
+
+ * Shared/efl/ProcessExecutablePathEfl.cpp:
+ (WebKit::findProcessPath): Change the logic to look initially in
+ WEBKIT_EXEC_PATH, then proceed with the existing checks.
+ * UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestEnvironment.cpp:
+ (EWK2UnitTest::EWK2UnitTestEnvironment::EWK2UnitTestEnvironment):
+ Define WEBKIT_EXEC_PATH to be used by EWebKit2 tests.
+
2014-01-12 Darin Adler <[email protected]>
Add deprecatedCharacters as a synonym for characters and convert most call sites
Modified: trunk/Source/WebKit2/Shared/efl/ProcessExecutablePathEfl.cpp (161856 => 161857)
--- trunk/Source/WebKit2/Shared/efl/ProcessExecutablePathEfl.cpp 2014-01-13 04:03:56 UTC (rev 161856)
+++ trunk/Source/WebKit2/Shared/efl/ProcessExecutablePathEfl.cpp 2014-01-13 04:09:39 UTC (rev 161857)
@@ -28,16 +28,24 @@
#include "FileSystem.h"
#include <libgen.h>
-#include <sys/stat.h>
-#include <sys/types.h>
#include <unistd.h>
#include <wtf/StdLibExtras.h>
#include <wtf/text/CString.h>
namespace WebKit {
+// We initially look for the process in WEBKIT_EXEC_PATH, then proceed to try the working
+// directory of the running process, and finally we try LIBEXECDIR (usually /usr/local/bin).
static String findProcessPath(const char* processName)
{
+ String executablePath;
+ static const char* execDirectory = getenv("WEBKIT_EXEC_PATH");
+ if (execDirectory) {
+ executablePath = WebCore::pathByAppendingComponent(String::fromUTF8(execDirectory), processName);
+ if (WebCore::fileExists(executablePath))
+ return executablePath;
+ }
+
#if OS(UNIX)
char readLinkBuffer[PATH_MAX] = {0};
@@ -48,16 +56,14 @@
#endif
if (result > 0) {
char* executablePathPtr = dirname(readLinkBuffer);
- String executablePath = WebCore::pathByAppendingComponent(String(executablePathPtr), processName);
-
- // Checks whether process exist on the current path.
- struct stat fileStat;
- if (!stat(executablePath.utf8().data(), &fileStat))
+ executablePath = WebCore::pathByAppendingComponent(String::fromUTF8(executablePathPtr), processName);
+ if (WebCore::fileExists(executablePath))
return executablePath;
}
#endif
-
- return WebCore::pathByAppendingComponent(String(LIBEXECDIR), processName);
+ executablePath = WebCore::pathByAppendingComponent(String(LIBEXECDIR), processName);
+ ASSERT(WebCore::fileExists(executablePath));
+ return executablePath;
}
String executablePathOfWebProcess()
Modified: trunk/Source/WebKit2/UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestEnvironment.cpp (161856 => 161857)
--- trunk/Source/WebKit2/UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestEnvironment.cpp 2014-01-13 04:03:56 UTC (rev 161856)
+++ trunk/Source/WebKit2/UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestEnvironment.cpp 2014-01-13 04:09:39 UTC (rev 161857)
@@ -30,6 +30,7 @@
: m_defaultWidth(800)
, m_defaultHeight(600)
{
+ setenv("WEBKIT_EXEC_PATH", WEBKIT_EXEC_PATH, false);
}
const char* EWK2UnitTestEnvironment::defaultTestPageUrl() const
Modified: trunk/Source/cmake/OptionsEfl.cmake (161856 => 161857)
--- trunk/Source/cmake/OptionsEfl.cmake 2014-01-13 04:03:56 UTC (rev 161856)
+++ trunk/Source/cmake/OptionsEfl.cmake 2014-01-13 04:09:39 UTC (rev 161857)
@@ -287,3 +287,6 @@
find_package(LLVM REQUIRED)
set(HAVE_LLVM ON)
endif ()
+
+# [E]WebKit2 tests need a hint to find out where processes such as WebProcess are located at.
+add_definitions(-DWEBKIT_EXEC_PATH=\"${CMAKE_RUNTIME_OUTPUT_DIRECTORY}\")
Modified: trunk/Tools/ChangeLog (161856 => 161857)
--- trunk/Tools/ChangeLog 2014-01-13 04:03:56 UTC (rev 161856)
+++ trunk/Tools/ChangeLog 2014-01-13 04:09:39 UTC (rev 161857)
@@ -1,3 +1,22 @@
+2014-01-12 Sergio Correia <[email protected]>
+
+ [EFL][WK2] Make API tests work again
+ https://bugs.webkit.org/show_bug.cgi?id=126769
+
+ Reviewed by Gyuyoung Kim.
+
+ The EFL and WK2 test binaries are currently being generated at *TestWebKitAPI/
+ [E]WebKit2, respectively, and this causes problems because the logic to find
+ where WebProcess is to look in the same directory of the running process and
+ then proceed to use LIBEXECDIR (typically /usr/loca/bin).
+
+ This patch introduces a WEBKIT_EXEC_PATH environment variable, inspired in the
+ Gtk port, which allows us to look for WebProcess initially in this directory,
+ if it's defined.
+
+ * TestWebKitAPI/efl/main.cpp:
+ (main): Define WEBKIT_EXEC_PATH to be used by WebKit2 API tests.
+
2014-01-12 Daniel Bates <[email protected]>
[iOS] Fix the build
Modified: trunk/Tools/TestWebKitAPI/efl/main.cpp (161856 => 161857)
--- trunk/Tools/TestWebKitAPI/efl/main.cpp 2014-01-13 04:03:56 UTC (rev 161856)
+++ trunk/Tools/TestWebKitAPI/efl/main.cpp 2014-01-13 04:09:39 UTC (rev 161857)
@@ -50,6 +50,7 @@
int main(int argc, char** argv)
{
WTFInstallReportBacktraceOnCrashHook();
+ setenv("WEBKIT_EXEC_PATH", WEBKIT_EXEC_PATH, false);
if (!eina_init())
return EXIT_FAILURE;