WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
119085
[EFL][WK2] Simplify context_menu_spelling_items_availability unit test
https://bugs.webkit.org/show_bug.cgi?id=119085
Summary
[EFL][WK2] Simplify context_menu_spelling_items_availability unit test
Grzegorz Czajkowski
Reported
2013-07-25 06:36:29 PDT
Use findContextMenuItem method to check whether the item appears in context menu.
Attachments
proposed patch
(4.27 KB, patch)
2013-07-25 06:40 PDT
,
Grzegorz Czajkowski
no flags
Details
Formatted Diff
Diff
verify return value of each findContextMenuItem call
(6.49 KB, patch)
2013-07-26 02:35 PDT
,
Grzegorz Czajkowski
no flags
Details
Formatted Diff
Diff
apply Gyuyoung's review
(6.49 KB, patch)
2013-07-26 03:21 PDT
,
Grzegorz Czajkowski
gyuyoung.kim
: review+
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Grzegorz Czajkowski
Comment 1
2013-07-25 06:40:07 PDT
Created
attachment 207454
[details]
proposed patch
Gyuyoung Kim
Comment 2
2013-07-25 17:20:38 PDT
Comment on
attachment 207454
[details]
proposed patch View in context:
https://bugs.webkit.org/attachment.cgi?id=207454&action=review
LGTM.
> Source/WebKit2/ChangeLog:13 > + Do not report failure here. It doesn't allow to test the negative test cases.
Shouldn't you need to check if existing uses of findContextMenuItem() are also failed ?
Gyuyoung Kim
Comment 3
2013-07-25 17:22:29 PDT
(In reply to
comment #2
)
> (From update of
attachment 207454
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=207454&action=review
> > LGTM.
LGTM except for my question.
Grzegorz Czajkowski
Comment 4
2013-07-26 00:11:47 PDT
Comment on
attachment 207454
[details]
proposed patch View in context:
https://bugs.webkit.org/attachment.cgi?id=207454&action=review
>> Source/WebKit2/ChangeLog:13 >> + Do not report failure here. It doesn't allow to test the negative test cases. > > Shouldn't you need to check if existing uses of findContextMenuItem() are also failed ?
Present findContextMenuItem is being used to test the positive test cases only. Therefore it doesn't reach the 'error block' (ADD_FAILURE; return 0;) IMHO we should check result of findContextMenuItem in the test/callback instead of reporting failure inside. It prevents us to use the method to test negative test cases. Actually, the unit tests use findContextMenuItem to find an appropriate context menu item and to select it. The result of selected item is verified inside the tests. Assuming the positive test case, if findContextMenuItem fails the test will fail as well - the item won't be selected and the expected result will be different as well. The reason of introducing ADD_FAILURE() in findContextMenuItem was to report failure earlier.
Gyuyoung Kim
Comment 5
2013-07-26 02:15:06 PDT
(In reply to
comment #4
)
> Actually, the unit tests use findContextMenuItem to find an appropriate context menu item and to select it. The result of selected item is verified inside the tests. Assuming the positive test case, if findContextMenuItem fails the test will fail as well - the item won't be selected and the expected result will be different as well. > > The reason of introducing ADD_FAILURE() in findContextMenuItem was to report failure earlier.
I see. As we talk on irc, my question was that we need to check the result of findContextMenuItem() in other functions as well.
Grzegorz Czajkowski
Comment 6
2013-07-26 02:35:28 PDT
Created
attachment 207519
[details]
verify return value of each findContextMenuItem call
Gyuyoung Kim
Comment 7
2013-07-26 03:01:32 PDT
Comment on
attachment 207519
[details]
verify return value of each findContextMenuItem call View in context:
https://bugs.webkit.org/attachment.cgi?id=207519&action=review
> Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_text_checker.cpp:295 > + EXPECT_TRUE(spellingAndGrammarSubmenu);
Isn't checkSpellingWhileTypingItem instead of spellingAndGrammarSubmenu ?
Grzegorz Czajkowski
Comment 8
2013-07-26 03:11:37 PDT
Comment on
attachment 207519
[details]
verify return value of each findContextMenuItem call View in context:
https://bugs.webkit.org/attachment.cgi?id=207519&action=review
>> Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_text_checker.cpp:295 >> + EXPECT_TRUE(spellingAndGrammarSubmenu); > > Isn't checkSpellingWhileTypingItem instead of spellingAndGrammarSubmenu ?
Ooops. You're right. I'll fix it.
Grzegorz Czajkowski
Comment 9
2013-07-26 03:21:43 PDT
Created
attachment 207520
[details]
apply Gyuyoung's review
Gyuyoung Kim
Comment 10
2013-07-26 10:34:02 PDT
Comment on
attachment 207520
[details]
apply Gyuyoung's review View in context:
https://bugs.webkit.org/attachment.cgi?id=207520&action=review
> Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_text_checker.cpp:-559 > - ecore_main_loop_iterate();
When I ask EFL community this function, I could get this reply.... "DO NOT use this function unless you are the person God comes to ask for advice when He has trouble managing the Universe" Hey, greg, ryuan and chris, let's think about this function. As we know, we are not GOD. ;)
Gyuyoung Kim
Comment 11
2013-07-26 10:39:22 PDT
(In reply to
comment #10
)
> (From update of
attachment 207520
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=207520&action=review
> > > Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_text_checker.cpp:-559 > > - ecore_main_loop_iterate(); > > When I ask EFL community this function, I could get this reply.... > "DO NOT use this function unless you are the person God comes to ask for advice when He has trouble managing the Universe"
"DO NOT use this function unless you are the person God comes to ask for advice when He has trouble managing the Universe" Frankly speaking, I got this comment from EFL docs, not efl irc or mailing list...........Plz let me know if this comment is incorrect.
Chris Dumez
Comment 12
2013-07-26 10:44:20 PDT
(In reply to
comment #11
)
> (In reply to
comment #10
) > > (From update of
attachment 207520
[details]
[details]) > > View in context:
https://bugs.webkit.org/attachment.cgi?id=207520&action=review
> > > > > Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_text_checker.cpp:-559 > > > - ecore_main_loop_iterate(); > > > > When I ask EFL community this function, I could get this reply.... > > "DO NOT use this function unless you are the person God comes to ask for advice when He has trouble managing the Universe" > > "DO NOT use this function unless you are the person God comes to ask for advice when He has trouble managing the Universe" > > Frankly speaking, I got this comment from EFL docs, not efl irc or mailing list...........Plz let me know if this comment is incorrect.
We are using this function in the API tests, I don't think this is a big deal. Anyway, this part of the patch does not really get rid of ecore_main_loop_iterate(), it merely hides it.
Grzegorz Czajkowski
Comment 13
2013-07-26 12:13:07 PDT
Comment on
attachment 207520
[details]
apply Gyuyoung's review View in context:
https://bugs.webkit.org/attachment.cgi?id=207520&action=review
>>>> Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_text_checker.cpp:-559 >>>> - ecore_main_loop_iterate(); >>> >>> When I ask EFL community this function, I could get this reply.... >>> "DO NOT use this function unless you are the person God comes to ask for advice when He has trouble managing the Universe" >>> >>> Hey, greg, ryuan and chris, let's think about this function. As we know, we are not GOD. ;) >> >> "DO NOT use this function unless you are the person God comes to ask for advice when He has trouble managing the Universe" >> >> Frankly speaking, I got this comment from EFL docs, not efl irc or mailing list...........Plz let me know if this comment is incorrect. > > We are using this function in the API tests, I don't think this is a big deal. > Anyway, this part of the patch does not really get rid of ecore_main_loop_iterate(), it merely hides it.
Yeah, using ecore_main_loop_iterate() in unit tests shouldn't affect the Universe ;) As Chris said, we are using it in many aspects and replacing it with waitUntilTrue() is rather to match consistency with other tests which already use it.
Gyuyoung Kim
Comment 14
2013-07-28 13:49:26 PDT
(In reply to
comment #13
)
> > We are using this function in the API tests, I don't think this is a big deal. > > Anyway, this part of the patch does not really get rid of ecore_main_loop_iterate(), it merely hides it. > > Yeah, using ecore_main_loop_iterate() in unit tests shouldn't affect the Universe ;) > As Chris said, we are using it in many aspects and replacing it with waitUntilTrue() is rather to match consistency with other tests which already use it.
Ok, let's replace it with waitUntilTrue() from now on.
Grzegorz Czajkowski
Comment 15
2013-07-29 00:16:10 PDT
Committed
r153419
: <
http://trac.webkit.org/changeset/153419
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug