Bug 116601 - [EFL][WK2] Fix test_ewk2_context_menu
Summary: [EFL][WK2] Fix test_ewk2_context_menu
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit EFL (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Michal Pakula vel Rutka
URL:
Keywords:
Depends on: 116830 117298
Blocks:
  Show dependency treegraph
 
Reported: 2013-05-22 02:33 PDT by Michal Pakula vel Rutka
Modified: 2013-06-11 01:35 PDT (History)
5 users (show)

See Also:


Attachments
proposed patch (12.17 KB, patch)
2013-05-27 08:28 PDT, Michal Pakula vel Rutka
no flags Details | Formatted Diff | Diff
patch (14.09 KB, patch)
2013-06-07 01:48 PDT, Michal Pakula vel Rutka
no flags Details | Formatted Diff | Diff
fixes after review (14.88 KB, patch)
2013-06-07 05:56 PDT, Michal Pakula vel Rutka
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michal Pakula vel Rutka 2013-05-22 02:33:29 PDT
test_ewk2_context_menu is always passing, it does not test any context menu feature as it ends before context menu is called.
Comment 1 Michal Pakula vel Rutka 2013-05-27 08:28:59 PDT
Created attachment 202988 [details]
proposed patch
Comment 2 Michal Pakula vel Rutka 2013-06-07 01:48:02 PDT
Created attachment 204013 [details]
patch
Comment 3 Grzegorz Czajkowski 2013-06-07 03:02:42 PDT
Comment on attachment 204013 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=204013&action=review

> Source/WebKit2/UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.cpp:227
> +bool EWK2UnitTestBase::waitUntilTrue(bool &flag, double timeoutSeconds)

flag doesn't need to be passed as a reference, the method doesn't change it.

> Source/WebKit2/UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.h:53
> +    bool waitUntilTrue(bool &flag, double timeoutSeconds = defaultTimeoutSeconds);

timeoutSeconds -> timeoutInSeconds ?
defaultTimeoutSeconds -> defaultTimeoutInSeconds ? ( I don't think the reviewers will be against of changing it even if this patch doesn't introduce it)

> Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_context_menu.cpp:33
> +static const int customItemTag = EWK_CONTEXT_MENU_ITEM_BASE_APPLICATION_TAG;

It seems that it's always converted to Ewk_Context_Menu_Item_Action. Wouldn't be better to define it as Ewk_Context_Menu_Item_Action?

> Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_context_menu.cpp:76
> +    ewk_context_menu_item_title_set(item, "Copy Link");

It'd be nice to define all those item titles somewhere.

> Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_context_menu.cpp:88
> +

Could you add short note what the callback tests?

> Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_context_menu.cpp:120
> +

Ditto.

> Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_context_menu.cpp:161
>      return true;

return testFinished;
Comment 4 Grzegorz Czajkowski 2013-06-07 03:13:03 PDT
Comment on attachment 204013 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=204013&action=review

>> Source/WebKit2/UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.cpp:227
>> +bool EWK2UnitTestBase::waitUntilTrue(bool &flag, double timeoutSeconds)
> 
> flag doesn't need to be passed as a reference, the method doesn't change it.

Please skip this comment. I missed that it's changed somewhere else.
Comment 5 Michal Pakula vel Rutka 2013-06-07 03:32:01 PDT
Comment on attachment 204013 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=204013&action=review

>> Source/WebKit2/UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.h:53
>> +    bool waitUntilTrue(bool &flag, double timeoutSeconds = defaultTimeoutSeconds);
> 
> timeoutSeconds -> timeoutInSeconds ?
> defaultTimeoutSeconds -> defaultTimeoutInSeconds ? ( I don't think the reviewers will be against of changing it even if this patch doesn't introduce it)

defaultTimeoutSeconds and timeoutSeconds are used in several places in this file, I would rather change the names in separate patch

>> Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_context_menu.cpp:33
>> +static const int customItemTag = EWK_CONTEXT_MENU_ITEM_BASE_APPLICATION_TAG;
> 
> It seems that it's always converted to Ewk_Context_Menu_Item_Action. Wouldn't be better to define it as Ewk_Context_Menu_Item_Action?

done

>> Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_context_menu.cpp:76
>> +    ewk_context_menu_item_title_set(item, "Copy Link");
> 
> It'd be nice to define all those item titles somewhere.

done

>> Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_context_menu.cpp:88
>> +
> 
> Could you add short note what the callback tests?

done
Comment 6 Michal Pakula vel Rutka 2013-06-07 05:56:19 PDT
Created attachment 204034 [details]
fixes after review
Comment 7 Chris Dumez 2013-06-10 02:38:45 PDT
Comment on attachment 204034 [details]
fixes after review

View in context: https://bugs.webkit.org/attachment.cgi?id=204034&action=review

LGTM. I'll let Gyuyoung take a look.

> Source/WebKit2/UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.cpp:227
> +bool EWK2UnitTestBase::waitUntilTrue(bool &flag, double timeoutSeconds)

Nice addition.
Comment 8 Gyuyoung Kim 2013-06-10 18:49:59 PDT
Comment on attachment 204034 [details]
fixes after review

Looks nice as well.
Comment 9 WebKit Commit Bot 2013-06-11 01:35:54 PDT
Comment on attachment 204034 [details]
fixes after review

Clearing flags on attachment: 204034

Committed r151428: <http://trac.webkit.org/changeset/151428>
Comment 10 WebKit Commit Bot 2013-06-11 01:35:58 PDT
All reviewed patches have been landed.  Closing bug.