Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[EFL][DRT] Implements LayoutTestController's setPopupBlockingEnabled.
https://bugs.webkit.org/show_bug.cgi?id=80137

Patch by Grzegorz Czajkowski <g.czajkowski@samsung.com> on 2012-03-06
Reviewed by Eric Seidel.

Tools:

Adds implementation LayoutTestController's setPopupBlockingEnabled.
To pass popup-blocking-click-in-iframe.html EventSender should not
repeat click events in idler's function. EventSender allows to
asynchronously send click event through ecore_idler_add.
This event will be called repeatedly as long as it return true.
Click event should be called only once by returning ECORE_CALLBACK_CANCEL.

* DumpRenderTree/efl/EventSender.cpp:
(sendMouseEvent): Changed return value from bool to void because it always returns true.
(sendClick): Idler is deleted by returning ECORE_CALLBACK_CANCEL.
(mouseDownCallback): Remove unnecessary checking of return value.
* DumpRenderTree/efl/LayoutTestControllerEfl.cpp:
(LayoutTestController::setPopupBlockingEnabled):

LayoutTests:

Enables tests connected with setPopupBlockingEnabled.

* platform/efl/Skipped:

Canonical link: https://commits.webkit.org/97646@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@110028 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
grzegorz-czajkowski authored and webkit-commit-queue committed Mar 7, 2012
1 parent 0a89773 commit 7ad7aa6
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 27 deletions.
11 changes: 11 additions & 0 deletions LayoutTests/ChangeLog
@@ -1,3 +1,14 @@
2012-03-06 Grzegorz Czajkowski <g.czajkowski@samsung.com>

[EFL][DRT] Implements LayoutTestController's setPopupBlockingEnabled.
https://bugs.webkit.org/show_bug.cgi?id=80137

Reviewed by Eric Seidel.

Enables tests connected with setPopupBlockingEnabled.

* platform/efl/Skipped:

2012-03-06 Philippe Normand <pnormand@igalia.com>

Unreviewed, GTK test_expectations update after r109934.
Expand Down
19 changes: 0 additions & 19 deletions LayoutTests/platform/efl/Skipped
Expand Up @@ -554,25 +554,6 @@ editing/selection/doubleclick-whitespace-crash.html
editing/selection/doubleclick-whitespace-img-crash.html
editing/selection/doubleclick-whitespace.html

# EFL's LayoutTestController does not implement setPopupBlockingEnabled
fast/events/open-window-from-another-frame.html
fast/events/popup-allowed-from-gesture-initiated-event.html
fast/events/popup-allowed-from-gesture-initiated-form-submit.html
fast/events/popup-blocked-from-fake-button-click.html
fast/events/popup-blocked-from-fake-focus.html
fast/events/popup-blocked-from-fake-user-gesture.html
fast/events/popup-blocked-from-history-reload.html
fast/events/popup-blocked-from-iframe-script.html
fast/events/popup-blocked-from-iframe-src.html
fast/events/popup-blocked-from-mousemove.html
fast/events/popup-blocked-from-untrusted-click-event-on-anchor.html
fast/events/popup-blocked-from-untrusted-mouse-click.html
fast/events/popup-blocked-from-window-open.html
fast/events/popup-blocked-to-post-blank.html
fast/events/popup-blocking-click-in-iframe.html
fast/events/popup-blocking-timers.html
fast/events/popup-when-select-change.html

# EFL's LayoutTestController does not implement elementDoesAutoCompleteForElementWithId
security/set-form-autocomplete-attribute.html

Expand Down
21 changes: 21 additions & 0 deletions Tools/ChangeLog
@@ -1,3 +1,24 @@
2012-03-06 Grzegorz Czajkowski <g.czajkowski@samsung.com>

[EFL][DRT] Implements LayoutTestController's setPopupBlockingEnabled.
https://bugs.webkit.org/show_bug.cgi?id=80137

Reviewed by Eric Seidel.

Adds implementation LayoutTestController's setPopupBlockingEnabled.
To pass popup-blocking-click-in-iframe.html EventSender should not
repeat click events in idler's function. EventSender allows to
asynchronously send click event through ecore_idler_add.
This event will be called repeatedly as long as it return true.
Click event should be called only once by returning ECORE_CALLBACK_CANCEL.

* DumpRenderTree/efl/EventSender.cpp:
(sendMouseEvent): Changed return value from bool to void because it always returns true.
(sendClick): Idler is deleted by returning ECORE_CALLBACK_CANCEL.
(mouseDownCallback): Remove unnecessary checking of return value.
* DumpRenderTree/efl/LayoutTestControllerEfl.cpp:
(LayoutTestController::setPopupBlockingEnabled):

2012-03-06 Dirk Pranke <dpranke@chromium.org>

rebaseline_chromium_webkit_tests is obsolete and should be removed
Expand Down
10 changes: 4 additions & 6 deletions Tools/DumpRenderTree/efl/EventSender.cpp
Expand Up @@ -130,7 +130,7 @@ static EvasMouseButton translateMouseButtonNumber(int eventSenderButtonNumber)
return EvasMouseButtonLeft;
}

static bool sendMouseEvent(Evas* evas, EvasMouseEvent event, int buttonNumber, EvasKeyModifier modifiers)
static void sendMouseEvent(Evas* evas, EvasMouseEvent event, int buttonNumber, EvasKeyModifier modifiers)
{
unsigned timeStamp = 0;

Expand All @@ -155,13 +155,12 @@ static bool sendMouseEvent(Evas* evas, EvasMouseEvent event, int buttonNumber, E
evas_event_feed_mouse_wheel(evas, 1, (event & EvasMouseEventScrollLeft) ? 10 : -10, timeStamp, 0);

setEvasModifiers(evas, EvasKeyModifierNone);

return true;
}

static Eina_Bool sendClick(void*)
{
return !!sendMouseEvent(evas_object_evas_get(browser->mainFrame()), EvasMouseEventClick, EvasMouseButtonLeft, EvasKeyModifierNone);
sendMouseEvent(evas_object_evas_get(browser->mainFrame()), EvasMouseEventClick, EvasMouseButtonLeft, EvasKeyModifierNone);
return ECORE_CALLBACK_CANCEL;
}

static JSValueRef scheduleAsynchronousClickCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
Expand Down Expand Up @@ -232,8 +231,7 @@ static JSValueRef mouseDownCallback(JSContextRef context, JSObjectRef function,
updateClickCount(button);

EvasKeyModifier modifiers = argumentCount >= 2 ? modifiersFromJSValue(context, arguments[1]) : EvasKeyModifierNone;
if (!sendMouseEvent(evas_object_evas_get(browser->mainFrame()), EvasMouseEventDown, button, modifiers))
return JSValueMakeUndefined(context);
sendMouseEvent(evas_object_evas_get(browser->mainFrame()), EvasMouseEventDown, button, modifiers);

gButtonCurrentlyDown = button;
return JSValueMakeUndefined(context);
Expand Down
4 changes: 2 additions & 2 deletions Tools/DumpRenderTree/efl/LayoutTestControllerEfl.cpp
Expand Up @@ -436,9 +436,9 @@ void LayoutTestController::setSelectTrailingWhitespaceEnabled(bool)
notImplemented();
}

void LayoutTestController::setPopupBlockingEnabled(bool)
void LayoutTestController::setPopupBlockingEnabled(bool flag)
{
notImplemented();
ewk_view_setting_scripts_can_open_windows_set(browser->mainView(), !flag);
}

void LayoutTestController::setPluginsEnabled(bool flag)
Expand Down

0 comments on commit 7ad7aa6

Please sign in to comment.