Title: [89616] trunk/Tools
- Revision
- 89616
- Author
- [email protected]
- Date
- 2011-06-23 14:41:35 -0700 (Thu, 23 Jun 2011)
Log Message
2011-06-23 Martin Robinson <[email protected]>
Reviewed by Xan Lopez.
[GTK] [WebKit2] WebKitTestRunner does not properly load TestNetscapePlugin
https://bugs.webkit.org/show_bug.cgi?id=63287
Send the path to the TestNetscapePlugin to the WKTR via an environment variable
so that the plugin loads properly.
* Scripts/old-run-webkit-tests: Pass the appropriate environment variable to WKTR.
* WebKitTestRunner/gtk/TestControllerGtk.cpp:
(WTR::getEnvironmentVariableAsUTF8String): Added this helper which abstracts away some
of the work for getting an environment variable and converting it to UTF-8.
(WTR::TestController::initializeInjectedBundlePath): Use the helper.
(WTR::TestController::initializeTestPluginDirectory): Get the path from an environment variable now.
Modified Paths
Diff
Modified: trunk/Tools/ChangeLog (89615 => 89616)
--- trunk/Tools/ChangeLog 2011-06-23 21:36:59 UTC (rev 89615)
+++ trunk/Tools/ChangeLog 2011-06-23 21:41:35 UTC (rev 89616)
@@ -1,3 +1,20 @@
+2011-06-23 Martin Robinson <[email protected]>
+
+ Reviewed by Xan Lopez.
+
+ [GTK] [WebKit2] WebKitTestRunner does not properly load TestNetscapePlugin
+ https://bugs.webkit.org/show_bug.cgi?id=63287
+
+ Send the path to the TestNetscapePlugin to the WKTR via an environment variable
+ so that the plugin loads properly.
+
+ * Scripts/old-run-webkit-tests: Pass the appropriate environment variable to WKTR.
+ * WebKitTestRunner/gtk/TestControllerGtk.cpp:
+ (WTR::getEnvironmentVariableAsUTF8String): Added this helper which abstracts away some
+ of the work for getting an environment variable and converting it to UTF-8.
+ (WTR::TestController::initializeInjectedBundlePath): Use the helper.
+ (WTR::TestController::initializeTestPluginDirectory): Get the path from an environment variable now.
+
2011-06-23 Adam Roben <[email protected]>
Record whether old-run-webkit-tests aborted early in results.html
Modified: trunk/Tools/Scripts/old-run-webkit-tests (89615 => 89616)
--- trunk/Tools/Scripts/old-run-webkit-tests 2011-06-23 21:36:59 UTC (rev 89615)
+++ trunk/Tools/Scripts/old-run-webkit-tests 2011-06-23 21:41:35 UTC (rev 89616)
@@ -1502,6 +1502,8 @@
if ($useWebKitTestRunner) {
my $injectedBundlePath = productDir() . "/Libraries/.libs/libTestRunnerInjectedBundle";
$CLEAN_ENV{TEST_RUNNER_INJECTED_BUNDLE_FILENAME} = $injectedBundlePath;
+ my $testPluginPath = productDir() . "/TestNetscapePlugin/.libs";
+ $CLEAN_ENV{TEST_RUNNER_TEST_PLUGIN_PATH} = $testPluginPath;
}
}
Modified: trunk/Tools/WebKitTestRunner/gtk/TestControllerGtk.cpp (89615 => 89616)
--- trunk/Tools/WebKitTestRunner/gtk/TestControllerGtk.cpp 2011-06-23 21:36:59 UTC (rev 89615)
+++ trunk/Tools/WebKitTestRunner/gtk/TestControllerGtk.cpp 2011-06-23 21:41:35 UTC (rev 89616)
@@ -68,24 +68,27 @@
gtk_main();
}
-void TestController::initializeInjectedBundlePath()
+static char* getEnvironmentVariableAsUTF8String(const char* variableName)
{
- const char* bundlePath = g_getenv("TEST_RUNNER_INJECTED_BUNDLE_FILENAME");
- if (!bundlePath) {
- fprintf(stderr, "TEST_RUNNER_INJECTED_BUNDLE_FILENAME environment variable not found\n");
+ const char* value = g_getenv(variableName);
+ if (!value) {
+ fprintf(stderr, "%s environment variable not found\n", variableName);
exit(0);
}
+ gsize bytesWritten;
+ return g_filename_to_utf8(value, -1, 0, &bytesWritten, 0);
+}
- gsize bytesWritten;
- GOwnPtr<char> utf8BundlePath(g_filename_to_utf8(bundlePath, -1, 0, &bytesWritten, 0));
+void TestController::initializeInjectedBundlePath()
+{
+ GOwnPtr<char> utf8BundlePath(getEnvironmentVariableAsUTF8String("TEST_RUNNER_INJECTED_BUNDLE_FILENAME"));
m_injectedBundlePath.adopt(WKStringCreateWithUTF8CString(utf8BundlePath.get()));
}
void TestController::initializeTestPluginDirectory()
{
- // This is called after initializeInjectedBundlePath.
- ASSERT(m_injectedBundlePath);
- m_testPluginDirectory = m_injectedBundlePath;
+ GOwnPtr<char> testPluginPath(getEnvironmentVariableAsUTF8String("TEST_RUNNER_TEST_PLUGIN_PATH"));
+ m_testPluginDirectory.adopt(WKStringCreateWithUTF8CString(testPluginPath.get()));
}
void TestController::platformInitializeContext()
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes