summaryrefslogtreecommitdiff
path: root/Tools/WebKitTestRunner
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-07-30 11:37:48 +0200
committerSimon Hausmann <simon.hausmann@nokia.com>2012-07-30 11:38:52 +0200
commit89e2486a48b739f8d771d69ede5a6a1b244a10fc (patch)
tree503b1a7812cf97d93704c32437eb5f62dc1a1ff9 /Tools/WebKitTestRunner
parent625f028249cb37c55bbbd153f3902afd0b0756d9 (diff)
downloadqtwebkit-89e2486a48b739f8d771d69ede5a6a1b244a10fc.tar.gz
Imported WebKit commit 0282df8ca7c11d8c8a66ea18543695c69f545a27 (http://svn.webkit.org/repository/webkit/trunk@124002)
New snapshot with prospective Mountain Lion build fix
Diffstat (limited to 'Tools/WebKitTestRunner')
-rw-r--r--Tools/WebKitTestRunner/CMakeLists.txt2
-rw-r--r--Tools/WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl5
-rw-r--r--Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp18
-rw-r--r--Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h11
-rw-r--r--Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp53
-rw-r--r--Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.h5
-rw-r--r--Tools/WebKitTestRunner/TestController.cpp29
-rw-r--r--Tools/WebKitTestRunner/TestController.h2
-rw-r--r--Tools/WebKitTestRunner/efl/EventSenderProxyEfl.cpp54
-rw-r--r--Tools/WebKitTestRunner/efl/PlatformWebViewEfl.cpp2
-rw-r--r--Tools/WebKitTestRunner/efl/TestControllerEfl.cpp5
-rw-r--r--Tools/WebKitTestRunner/efl/main.cpp21
12 files changed, 146 insertions, 61 deletions
diff --git a/Tools/WebKitTestRunner/CMakeLists.txt b/Tools/WebKitTestRunner/CMakeLists.txt
index 4cc050150..badc2c471 100644
--- a/Tools/WebKitTestRunner/CMakeLists.txt
+++ b/Tools/WebKitTestRunner/CMakeLists.txt
@@ -26,6 +26,8 @@ SET(WebKitTestRunner_INCLUDE_DIRECTORIES
${WEBCORE_DIR}/editing
${WEBCORE_DIR}/platform
${WEBCORE_DIR}/platform/graphics
+ ${WEBCORE_DIR}/platform/graphics/harfbuzz
+ ${WEBCORE_DIR}/platform/graphics/harfbuzz/ng
${WEBCORE_DIR}/platform/network
${WEBCORE_DIR}/platform/text
${WEBCORE_DIR}/testing/js
diff --git a/Tools/WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl b/Tools/WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl
index 43062c5cc..768e89fe1 100644
--- a/Tools/WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl
+++ b/Tools/WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl
@@ -81,7 +81,6 @@ module WTR {
// Printing
int numberOfPages(in double pageWidthInPixels, in double pageHeightInPixels);
- int pageNumberForElementById(in DOMString id, in double pageWidthInPixels, in double pageHeightInPixels);
DOMString pageSizeAndMarginsInPixels(in int pageIndex, in int width, in int height, in int marginTop, in int marginRight, in int marginBottom, in int marginLeft);
boolean isPageBoxVisible(in int pageIndex);
@@ -129,6 +128,10 @@ module WTR {
void setShouldStayOnPageAfterHandlingBeforeUnload(in boolean flag);
void setDefersLoading(in boolean flag);
+
+ // Web intents testing.
+ void sendWebIntentResponse(in DOMString reply);
+ void deliverWebIntent(in DOMString action, in DOMString type, in DOMString data);
// Focus testing.
void addChromeInputField(in object callback);
diff --git a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
index c5bd14083..16371d1bc 100644
--- a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
+++ b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
@@ -50,6 +50,7 @@
#endif
#if ENABLE(WEB_INTENTS)
+#include <WebKit2/WKBundleIntentRequest.h>
#include <WebKit2/WKIntentData.h>
#endif
#if ENABLE(WEB_INTENTS_TAG)
@@ -361,7 +362,7 @@ void InjectedBundlePage::resetAfterTest()
WKBundleFrameRef frame = WKBundlePageGetMainFrame(m_page);
JSGlobalContextRef context = WKBundleFrameGetJavaScriptContext(frame);
#if PLATFORM(QT)
- DumpRenderTreeSupportQt::injectInternalsObject(context);
+ DumpRenderTreeSupportQt::resetInternalsObject(context);
#else
WebCoreTestSupport::resetInternalsObject(context);
#endif
@@ -425,20 +426,23 @@ void InjectedBundlePage::didFinishProgress(WKBundlePageRef, const void *clientIn
static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didFinishProgress();
}
-void InjectedBundlePage::didReceiveIntentForFrame(WKBundlePageRef page, WKBundleFrameRef frame, WKIntentDataRef intent, WKTypeRef* userData, const void* clientInfo)
+void InjectedBundlePage::didReceiveIntentForFrame(WKBundlePageRef page, WKBundleFrameRef frame, WKBundleIntentRequestRef intentRequest, WKTypeRef* userData, const void* clientInfo)
{
#if ENABLE(WEB_INTENTS)
+ static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->m_currentIntentRequest = intentRequest;
+ WKRetainPtr<WKIntentDataRef> intent(AdoptWK, WKBundleIntentRequestCopyIntentData(intentRequest));
+
InjectedBundle::shared().stringBuilder()->append("Received Web Intent: action=");
- WKRetainPtr<WKStringRef> wkAction(AdoptWK, WKIntentDataCopyAction(intent));
+ WKRetainPtr<WKStringRef> wkAction(AdoptWK, WKIntentDataCopyAction(intent.get()));
InjectedBundle::shared().stringBuilder()->append(toWTFString(wkAction.get()));
InjectedBundle::shared().stringBuilder()->append(" type=");
- WKRetainPtr<WKStringRef> wkType(AdoptWK, WKIntentDataCopyType(intent));
+ WKRetainPtr<WKStringRef> wkType(AdoptWK, WKIntentDataCopyType(intent.get()));
InjectedBundle::shared().stringBuilder()->append(toWTFString(wkType.get()));
InjectedBundle::shared().stringBuilder()->append("\n");
// FIXME: Print number of ports when exposed in WebKit2
- WKRetainPtr<WKURLRef> wkServiceUrl(AdoptWK, WKIntentDataCopyService(intent));
+ WKRetainPtr<WKURLRef> wkServiceUrl(AdoptWK, WKIntentDataCopyService(intent.get()));
if (wkServiceUrl) {
WKRetainPtr<WKStringRef> wkService(AdoptWK, WKURLCopyString(wkServiceUrl.get()));
if (wkService && !WKStringIsEmpty(wkService.get())) {
@@ -448,7 +452,7 @@ void InjectedBundlePage::didReceiveIntentForFrame(WKBundlePageRef page, WKBundle
}
}
- WKRetainPtr<WKDictionaryRef> wkExtras(AdoptWK, WKIntentDataCopyExtras(intent));
+ WKRetainPtr<WKDictionaryRef> wkExtras(AdoptWK, WKIntentDataCopyExtras(intent.get()));
WKRetainPtr<WKArrayRef> wkExtraKeys(AdoptWK, WKDictionaryCopyKeys(wkExtras.get()));
const size_t numExtraKeys = WKArrayGetSize(wkExtraKeys.get());
for (size_t i = 0; i < numExtraKeys; ++i) {
@@ -461,7 +465,7 @@ void InjectedBundlePage::didReceiveIntentForFrame(WKBundlePageRef page, WKBundle
InjectedBundle::shared().stringBuilder()->append("\n");
}
- WKRetainPtr<WKArrayRef> wkSuggestions(AdoptWK, WKIntentDataCopySuggestions(intent));
+ WKRetainPtr<WKArrayRef> wkSuggestions(AdoptWK, WKIntentDataCopySuggestions(intent.get()));
const size_t numSuggestions = WKArrayGetSize(wkSuggestions.get());
for (size_t i = 0; i < numSuggestions; ++i) {
WKStringRef wkSuggestion = static_cast<WKStringRef>(WKArrayGetItemAtIndex(wkSuggestions.get(), i));
diff --git a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h
index 824b1dfbd..074314e64 100644
--- a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h
+++ b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h
@@ -38,6 +38,11 @@ public:
~InjectedBundlePage();
WKBundlePageRef page() const { return m_page; }
+
+#if ENABLE(WEB_INTENTS)
+ WKBundleIntentRequestRef currentIntentRequest() const { return m_currentIntentRequest.get(); }
+#endif
+
void dump();
void stopLoading();
@@ -72,7 +77,7 @@ private:
static void didReceiveContentLengthForResource(WKBundlePageRef, WKBundleFrameRef, uint64_t identifier, uint64_t length, const void*);
static void didFinishLoadForResource(WKBundlePageRef, WKBundleFrameRef, uint64_t identifier, const void*);
static void didFailLoadForResource(WKBundlePageRef, WKBundleFrameRef, uint64_t identifier, WKErrorRef, const void*);
- static void didReceiveIntentForFrame(WKBundlePageRef, WKBundleFrameRef, WKIntentDataRef, WKTypeRef*, const void*);
+ static void didReceiveIntentForFrame(WKBundlePageRef, WKBundleFrameRef, WKBundleIntentRequestRef, WKTypeRef*, const void*);
static void registerIntentServiceForFrame(WKBundlePageRef, WKBundleFrameRef, WKIntentServiceInfoRef, WKTypeRef*, const void*);
void didStartProvisionalLoadForFrame(WKBundleFrameRef);
@@ -164,6 +169,10 @@ private:
WKBundlePageRef m_page;
WKRetainPtr<WKBundleScriptWorldRef> m_world;
WKRetainPtr<WKBundleBackForwardListItemRef> m_previousTestBackForwardListItem;
+
+#if ENABLE(WEB_INTENTS)
+ WKRetainPtr<WKBundleIntentRequestRef> m_currentIntentRequest;
+#endif
};
} // namespace WTR
diff --git a/Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp b/Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp
index a365bff55..4981b3c58 100644
--- a/Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp
+++ b/Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp
@@ -42,11 +42,17 @@
#include <WebKit2/WKBundlePrivate.h>
#include <WebKit2/WKBundleScriptWorld.h>
#include <WebKit2/WKRetainPtr.h>
+#include <WebKit2/WKSerializedScriptValue.h>
#include <WebKit2/WebKit2.h>
#include <wtf/CurrentTime.h>
#include <wtf/HashMap.h>
#include <wtf/text/StringBuilder.h>
+#if ENABLE(WEB_INTENTS)
+#include <WebKit2/WKBundleIntentRequest.h>
+#include <WebKit2/WKIntentData.h>
+#endif
+
namespace WTR {
// This is lower than DumpRenderTree's timeout, to make it easier to work through the failures
@@ -374,12 +380,6 @@ int LayoutTestController::numberOfPages(double pageWidthInPixels, double pageHei
return WKBundleNumberOfPages(InjectedBundle::shared().bundle(), mainFrame, pageWidthInPixels, pageHeightInPixels);
}
-int LayoutTestController::pageNumberForElementById(JSStringRef id, double pageWidthInPixels, double pageHeightInPixels)
-{
- WKBundleFrameRef mainFrame = WKBundlePageGetMainFrame(InjectedBundle::shared().page()->page());
- return WKBundlePageNumberForElementById(InjectedBundle::shared().bundle(), mainFrame, toWK(id).get(), pageWidthInPixels, pageHeightInPixels);
-}
-
JSRetainPtr<JSStringRef> LayoutTestController::pageSizeAndMarginsInPixels(int pageIndex, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft)
{
WKBundleFrameRef mainFrame = WKBundlePageGetMainFrame(InjectedBundle::shared().page()->page());
@@ -613,6 +613,47 @@ void LayoutTestController::overridePreference(JSStringRef preference, bool value
WKBundleOverrideBoolPreferenceForTestRunner(InjectedBundle::shared().bundle(), InjectedBundle::shared().pageGroup(), toWK(preference).get(), value);
}
+void LayoutTestController::sendWebIntentResponse(JSStringRef reply)
+{
+#if ENABLE(WEB_INTENTS)
+ WKRetainPtr<WKBundleIntentRequestRef> currentRequest = InjectedBundle::shared().page()->currentIntentRequest();
+ if (!currentRequest)
+ return;
+
+ WKBundleFrameRef mainFrame = WKBundlePageGetMainFrame(InjectedBundle::shared().page()->page());
+ JSContextRef context = WKBundleFrameGetJavaScriptContext(mainFrame);
+
+ if (reply) {
+ WKRetainPtr<WKSerializedScriptValueRef> serializedData(AdoptWK, WKSerializedScriptValueCreate(context, JSValueMakeString(context, reply), 0));
+ WKBundleIntentRequestPostResult(currentRequest.get(), serializedData.get());
+ } else {
+ JSRetainPtr<JSStringRef> errorReply(JSStringCreateWithUTF8CString("ERROR"));
+ WKRetainPtr<WKSerializedScriptValueRef> serializedData(AdoptWK, WKSerializedScriptValueCreate(context, JSValueMakeString(context, errorReply.get()), 0));
+ WKBundleIntentRequestPostFailure(currentRequest.get(), serializedData.get());
+ }
+#endif
+}
+
+void LayoutTestController::deliverWebIntent(JSStringRef action, JSStringRef type, JSStringRef data)
+{
+#if ENABLE(WEB_INTENTS)
+ WKBundleFrameRef mainFrame = WKBundlePageGetMainFrame(InjectedBundle::shared().page()->page());
+ JSContextRef context = WKBundleFrameGetJavaScriptContext(mainFrame);
+
+ WKRetainPtr<WKStringRef> actionWK = toWK(action);
+ WKRetainPtr<WKStringRef> typeWK = toWK(type);
+ WKRetainPtr<WKSerializedScriptValueRef> dataWK(AdoptWK, WKSerializedScriptValueCreate(context, JSValueMakeString(context, data), 0));
+
+ WKRetainPtr<WKMutableDictionaryRef> intentInitDict(AdoptWK, WKMutableDictionaryCreate());
+ WKDictionaryAddItem(intentInitDict.get(), WKStringCreateWithUTF8CString("action"), actionWK.get());
+ WKDictionaryAddItem(intentInitDict.get(), WKStringCreateWithUTF8CString("type"), typeWK.get());
+ WKDictionaryAddItem(intentInitDict.get(), WKStringCreateWithUTF8CString("data"), dataWK.get());
+
+ WKRetainPtr<WKIntentDataRef> wkIntentData(AdoptWK, WKIntentDataCreate(intentInitDict.get()));
+ WKBundlePageDeliverIntentToFrame(InjectedBundle::shared().page()->page(), mainFrame, wkIntentData.get());
+#endif
+}
+
void LayoutTestController::setAlwaysAcceptCookies(bool accept)
{
WKBundleSetAlwaysAcceptCookies(InjectedBundle::shared().bundle(), accept);
diff --git a/Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.h b/Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.h
index 35033e29f..304396343 100644
--- a/Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.h
+++ b/Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.h
@@ -141,7 +141,6 @@ public:
// Printing
int numberOfPages(double pageWidthInPixels, double pageHeightInPixels);
- int pageNumberForElementById(JSStringRef, double pageWidthInPixels, double pageHeightInPixels);
JSRetainPtr<JSStringRef> pageSizeAndMarginsInPixels(int pageIndex, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft);
bool isPageBoxVisible(int pageIndex);
@@ -206,6 +205,10 @@ public:
void overridePreference(JSStringRef preference, bool value);
+ // Web intents testing.
+ void sendWebIntentResponse(JSStringRef reply);
+ void deliverWebIntent(JSStringRef action, JSStringRef type, JSStringRef data);
+
// Cookies testing
void setAlwaysAcceptCookies(bool);
diff --git a/Tools/WebKitTestRunner/TestController.cpp b/Tools/WebKitTestRunner/TestController.cpp
index 8c2250831..d02329927 100644
--- a/Tools/WebKitTestRunner/TestController.cpp
+++ b/Tools/WebKitTestRunner/TestController.cpp
@@ -67,7 +67,7 @@ TestController& TestController::shared()
}
TestController::TestController(int argc, const char* argv[])
- : m_dumpPixels(false)
+ : m_dumpPixelsForAllTests(false)
, m_verbose(false)
, m_printSeparators(false)
, m_usingServerMode(false)
@@ -268,7 +268,7 @@ void TestController::initialize(int argc, const char* argv[])
}
if (argument == "--pixel-tests") {
- m_dumpPixels = true;
+ m_dumpPixelsForAllTests = true;
continue;
}
if (argument == "--verbose") {
@@ -517,18 +517,31 @@ bool TestController::runTest(const char* test)
return false;
}
- std::string pathOrURL(test);
+ bool dumpPixelsTest = m_dumpPixelsForAllTests;
+ std::string command(test);
+ std::string pathOrURL = command;
std::string expectedPixelHash;
- size_t separatorPos = pathOrURL.find("'");
- if (separatorPos != std::string::npos) {
- pathOrURL = std::string(std::string(test), 0, separatorPos);
- expectedPixelHash = std::string(std::string(test), separatorPos + 1);
+ size_t firstSeparatorPos = command.find_first_of('\'');
+ size_t secondSeparatorPos = command.find_first_of('\'', firstSeparatorPos + 1);
+ if (firstSeparatorPos != std::string::npos) {
+ pathOrURL = std::string(command, 0, firstSeparatorPos);
+ size_t pixelHashPos = firstSeparatorPos + 1;
+
+ // NRWT passes --pixel-test if we should dump pixels for the test.
+ const std::string expectedPixelTestArg("--pixel-test");
+ std::string argTest = std::string(command, firstSeparatorPos + 1, expectedPixelTestArg.size());
+ if (argTest == expectedPixelTestArg) {
+ dumpPixelsTest = true;
+ pixelHashPos = secondSeparatorPos == std::string::npos ? std::string::npos : secondSeparatorPos + 1;
+ }
+ if (pixelHashPos != std::string::npos && pixelHashPos < command.size())
+ expectedPixelHash = std::string(command, pixelHashPos);
}
m_state = RunningTest;
m_currentInvocation = adoptPtr(new TestInvocation(pathOrURL));
- if (m_dumpPixels)
+ if (dumpPixelsTest)
m_currentInvocation->setIsPixelTest(expectedPixelHash);
m_currentInvocation->invoke();
diff --git a/Tools/WebKitTestRunner/TestController.h b/Tools/WebKitTestRunner/TestController.h
index 20188ad55..a99e16ea8 100644
--- a/Tools/WebKitTestRunner/TestController.h
+++ b/Tools/WebKitTestRunner/TestController.h
@@ -104,7 +104,7 @@ private:
OwnPtr<TestInvocation> m_currentInvocation;
- bool m_dumpPixels;
+ bool m_dumpPixelsForAllTests;
bool m_verbose;
bool m_printSeparators;
bool m_usingServerMode;
diff --git a/Tools/WebKitTestRunner/efl/EventSenderProxyEfl.cpp b/Tools/WebKitTestRunner/efl/EventSenderProxyEfl.cpp
index 447a2c527..7154fa36b 100644
--- a/Tools/WebKitTestRunner/efl/EventSenderProxyEfl.cpp
+++ b/Tools/WebKitTestRunner/efl/EventSenderProxyEfl.cpp
@@ -37,6 +37,7 @@
#include <Ecore.h>
#include <Ecore_Evas.h>
+#include <unistd.h>
#include <wtf/OwnArrayPtr.h>
#include <wtf/PassOwnArrayPtr.h>
#include <wtf/text/CString.h>
@@ -141,10 +142,16 @@ static void setEvasModifiers(Evas* evas, WKEventModifiers wkModifiers)
}
}
-static void dispatchMouseDownEvent(Evas* evas, unsigned button, WKEventModifiers wkModifiers)
+static void dispatchMouseDownEvent(Evas* evas, unsigned button, WKEventModifiers wkModifiers, int clickCount)
{
+ Evas_Button_Flags buttonFlags = EVAS_BUTTON_NONE;
+ if (clickCount == 3)
+ buttonFlags = EVAS_BUTTON_TRIPLE_CLICK;
+ else if (clickCount == 2)
+ buttonFlags = EVAS_BUTTON_DOUBLE_CLICK;
+
setEvasModifiers(evas, wkModifiers);
- evas_event_feed_mouse_down(evas, button, EVAS_BUTTON_NONE, 0, 0);
+ evas_event_feed_mouse_down(evas, button, buttonFlags, 0, 0);
setEvasModifiers(evas, 0);
}
@@ -162,20 +169,11 @@ static void dispatchMouseMoveEvent(Evas* evas, int x, int y)
static void dispatchMouseScrollByEvent(Evas* evas, int horizontal, int vertical)
{
- const int SCROLLLEFT = -10;
- const int SCROLLRIGHT = 10;
- const int SCROLLDOWN = -10;
- const int SCROLLUP = 10;
-
- if (horizontal > 0)
- evas_event_feed_mouse_wheel(evas, 1, SCROLLLEFT, 0, 0);
- else if (horizontal < 0)
- evas_event_feed_mouse_wheel(evas, 1, SCROLLRIGHT, 0, 0);
-
- if (vertical > 0)
- evas_event_feed_mouse_wheel(evas, 0, SCROLLUP, 0, 0);
- else if (vertical < 0)
- evas_event_feed_mouse_wheel(evas, 0, SCROLLDOWN, 0, 0);
+ if (horizontal)
+ evas_event_feed_mouse_wheel(evas, 1, horizontal, 0, 0);
+
+ if (vertical)
+ evas_event_feed_mouse_wheel(evas, 0, vertical, 0, 0);
}
static const PassRefPtr<KeyEventInfo> keyPadName(WKStringRef keyRef)
@@ -233,6 +231,18 @@ static const PassRefPtr<KeyEventInfo> keyName(WKStringRef keyRef)
return adoptRef(new KeyEventInfo("Print", ""));
if (WKStringIsEqualToUTF8CString(keyRef, "menu"))
return adoptRef(new KeyEventInfo("Menu", ""));
+ if (WKStringIsEqualToUTF8CString(keyRef, "leftControl"))
+ return adoptRef(new KeyEventInfo("Control_L", ""));
+ if (WKStringIsEqualToUTF8CString(keyRef, "rightControl"))
+ return adoptRef(new KeyEventInfo("Control_R", ""));
+ if (WKStringIsEqualToUTF8CString(keyRef, "leftShift"))
+ return adoptRef(new KeyEventInfo("Shift_L", ""));
+ if (WKStringIsEqualToUTF8CString(keyRef, "rightShift"))
+ return adoptRef(new KeyEventInfo("Shift_R", ""));
+ if (WKStringIsEqualToUTF8CString(keyRef, "leftAlt"))
+ return adoptRef(new KeyEventInfo("Alt_L", ""));
+ if (WKStringIsEqualToUTF8CString(keyRef, "rightAlt"))
+ return adoptRef(new KeyEventInfo("Alt_R", ""));
if (WKStringIsEqualToUTF8CString(keyRef, "F1"))
return adoptRef(new KeyEventInfo("F1", ""));
if (WKStringIsEqualToUTF8CString(keyRef, "F2"))
@@ -303,7 +313,7 @@ void EventSenderProxy::updateClickCountForButton(int button)
void EventSenderProxy::dispatchEvent(const WTREvent& event)
{
if (event.eventType == WTREventTypeMouseDown)
- dispatchMouseDownEvent(ecore_evas_get(m_testController->mainWebView()->platformWindow()), event.button, event.modifiers);
+ dispatchMouseDownEvent(ecore_evas_get(m_testController->mainWebView()->platformWindow()), event.button, event.modifiers, m_clickCount);
else if (event.eventType == WTREventTypeMouseUp)
dispatchMouseUpEvent(ecore_evas_get(m_testController->mainWebView()->platformWindow()), event.button, event.modifiers);
else if (event.eventType == WTREventTypeMouseMove)
@@ -367,8 +377,10 @@ void EventSenderProxy::mouseMoveTo(double x, double y)
void EventSenderProxy::mouseScrollBy(int horizontal, int vertical)
{
WTREvent event(WTREventTypeMouseScrollBy, 0, 0, WTRMouseButtonNone);
- event.horizontal = horizontal;
- event.vertical = vertical;
+ // We need to invert scrolling values since in EFL negative z value means that
+ // canvas is scrolling down
+ event.horizontal = -horizontal;
+ event.vertical = -vertical;
sendOrQueueEvent(event);
}
@@ -389,6 +401,10 @@ void EventSenderProxy::keyDown(WKStringRef keyRef, WKEventModifiers wkModifiers,
const char* keyName = keyEventInfo->keyName.data();
const char* keyString = keyEventInfo->keyString.data();
+ // Enforce 'Shift' modifier for caps.
+ if ((strlen(keyName) == 1) && (keyName[0] >= 'A' && keyName[0] <= 'Z'))
+ wkModifiers |= kWKEventModifiersShiftKey;
+
Evas* evas = ecore_evas_get(m_testController->mainWebView()->platformWindow());
setEvasModifiers(evas, wkModifiers);
evas_event_feed_key_down(evas, keyName, keyName, keyString, 0, 0, 0);
diff --git a/Tools/WebKitTestRunner/efl/PlatformWebViewEfl.cpp b/Tools/WebKitTestRunner/efl/PlatformWebViewEfl.cpp
index c3c0863c8..85a8a5843 100644
--- a/Tools/WebKitTestRunner/efl/PlatformWebViewEfl.cpp
+++ b/Tools/WebKitTestRunner/efl/PlatformWebViewEfl.cpp
@@ -50,6 +50,7 @@ PlatformWebView::PlatformWebView(WKContextRef context, WKPageGroupRef pageGroup)
ewk_view_theme_set(m_view, THEME_DIR"/default.edj");
m_windowIsKey = false;
+ evas_object_show(m_view);
}
PlatformWebView::~PlatformWebView()
@@ -70,6 +71,7 @@ WKPageRef PlatformWebView::page()
void PlatformWebView::focus()
{
+ evas_object_focus_set(m_view, true);
}
WKRect PlatformWebView::windowFrame()
diff --git a/Tools/WebKitTestRunner/efl/TestControllerEfl.cpp b/Tools/WebKitTestRunner/efl/TestControllerEfl.cpp
index 87537f682..a184f6df4 100644
--- a/Tools/WebKitTestRunner/efl/TestControllerEfl.cpp
+++ b/Tools/WebKitTestRunner/efl/TestControllerEfl.cpp
@@ -50,6 +50,11 @@ void TestController::notifyDone()
void TestController::platformInitialize()
{
+ const char* isDebugging = getenv("WEB_PROCESS_CMD_PREFIX");
+ if (isDebugging && *isDebugging) {
+ m_useWaitToDumpWatchdogTimer = false;
+ m_forceNoTimeout = true;
+ }
}
void TestController::platformRunUntil(bool& condition, double timeout)
diff --git a/Tools/WebKitTestRunner/efl/main.cpp b/Tools/WebKitTestRunner/efl/main.cpp
index 42e0af286..c864ac13d 100644
--- a/Tools/WebKitTestRunner/efl/main.cpp
+++ b/Tools/WebKitTestRunner/efl/main.cpp
@@ -19,12 +19,8 @@
#include "config.h"
+#include "EWebKit2.h"
#include "TestController.h"
-#include <Ecore.h>
-#include <Ecore_Evas.h>
-#include <Edje.h>
-#include <glib-object.h>
-#include <glib.h>
#ifdef HAVE_ECORE_X
#include <Ecore_X.h>
@@ -32,20 +28,12 @@
int main(int argc, char** argv)
{
- g_type_init();
-
- if (!ecore_evas_init())
- return 1;
-
- if (!edje_init()) {
- ecore_evas_shutdown();
+ if (!ewk_init())
return 1;
- }
#ifdef HAVE_ECORE_X
if (!ecore_x_init(0)) {
- ecore_evas_shutdown();
- edje_shutdown();
+ ewk_shutdown();
return 1;
}
#endif
@@ -57,8 +45,7 @@ int main(int argc, char** argv)
ecore_x_shutdown();
#endif
- edje_shutdown();
- ecore_evas_shutdown();
+ ewk_shutdown();
return 0;
}