Closed
Bug 1125528
Opened 9 years ago
Closed 9 years ago
Create abstract class for SelectionHandler tests
Categories
(Firefox for Android Graveyard :: Text Selection, defect)
Tracking
(firefox39 fixed)
RESOLVED
FIXED
Firefox 39
Tracking | Status | |
---|---|---|
firefox39 | --- | fixed |
People
(Reporter: capella, Assigned: AndyP, Mentored)
Details
(Whiteboard: [lang=java])
Attachments
(1 file, 3 obsolete files)
12.38 KB,
patch
|
Margaret
:
review+
|
Details | Diff | Splinter Review |
The three SelectionHandler tests [1][2][3], use a (mostly) common parent class. Let's abstract it down even further, and extend our tests from there. [1] http://mxr.mozilla.org/mozilla-central/source/mobile/android/base/tests/testSelectionHandler.java [2] http://mxr.mozilla.org/mozilla-central/source/mobile/android/base/tests/testTextareaSelections.java [3] http://mxr.mozilla.org/mozilla-central/source/mobile/android/base/tests/testInputSelections.java
Reporter | ||
Updated•9 years ago
|
Mentor: markcapella
Whiteboard: [lang=java]
Comment 1•9 years ago
|
||
Hey hii,I wish to fix this bug.How do i start?
Reporter | ||
Comment 2•9 years ago
|
||
Hi aanand. Note that this is not labelled as a good-first-bug. If you're new to contributing, you might have trouble with this. If the description above doesn't give you a basic idea of what is required, you should look into other bugs to start contributing. You'll need a good working knowledge of Java, own an Android device, and be able to build and test the Android version of Firefox for Mobile devices. (This is easier if you already have a source repo and can build Firefox for desktop). A skilled first-time contributor should be able to finish this in a couple weeks. Others may take longer, as creating your local build and test environments the first time is a challenge of itself. See [4] for overall details, and the robocop section [5] for testing specifics. Leave comments / questions here, or look for me in IRC as nick:capella, in #introduction and #mobile channels. [4] https://wiki.mozilla.org/Mobile/Fennec/Android [5] https://wiki.mozilla.org/Mobile/Fennec/Android#Robocop
Comment 3•9 years ago
|
||
Thanks Mark,Its embarassing but im little stuckup in using IRC,I am really naive so can we talk somewhere else instead of IRC.I am sorry.
Comment 4•9 years ago
|
||
(In reply to Mark Capella [:capella] from comment #2) > Hi aanand. Note that this is not labelled as a good-first-bug. If you're new > to contributing, you might have trouble with this. If the description above > doesn't give you a basic idea of what is required, you should look into > other bugs to start contributing. > > You'll need a good working knowledge of Java, own an Android device, and be > able to build and test the Android version of Firefox for Mobile devices. > (This is easier if you already have a source repo and can build Firefox for > desktop). > > A skilled first-time contributor should be able to finish this in a couple > weeks. Others may take longer, as creating your local build and test > environments the first time is a challenge of itself. See [4] for overall > details, and the robocop section [5] for testing specifics. > > Leave comments / questions here, or look for me in IRC as nick:capella, in > #introduction and #mobile channels. > > > [4] https://wiki.mozilla.org/Mobile/Fennec/Android > [5] https://wiki.mozilla.org/Mobile/Fennec/Android#Robocop Thanks Mark,Its embarassing but im little stuckup in using IRC,I am really naive so can we talk somewhere else instead of IRC.I am really sorry.
Assignee | ||
Comment 5•9 years ago
|
||
I successfully ran the three tests locally. testSelectionHandler: http://pastebin.mozilla.org/8792006 testInputSelections: http://pastebin.mozilla.org/8792043 testTextareaSelections: http://pastebin.mozilla.org/8792044
Attachment #8565201 -
Flags: review?(markcapella)
Assignee | ||
Comment 6•9 years ago
|
||
I forgot the public methods of the tests and had a wrong variable name in SelectionHandlerTest. Is there a specific way to test the public methods? The previous tests should not have worked, maybe I've forgotten something.
Attachment #8565201 -
Attachment is obsolete: true
Attachment #8565201 -
Flags: review?(markcapella)
Attachment #8565209 -
Flags: review?(markcapella)
Reporter | ||
Updated•9 years ago
|
Assignee: nobody → 2013001
Status: NEW → ASSIGNED
Reporter | ||
Updated•9 years ago
|
Assignee: 2013001 → drag
Reporter | ||
Comment 7•9 years ago
|
||
Comment on attachment 8565209 [details] [diff] [review] bug1125528_createAbstractSelectionHandlerTest.diff -v2 Review of attachment 8565209 [details] [diff] [review]: ----------------------------------------------------------------- Looks good! For a final optimization, can we unify the individual geckoEventString values into a common "Robocop:testSelectionHandler" value. (Move const TYPE_NAME to SelectionUtil ?) ::: mobile/android/base/tests/SelectionHandlerTest.java @@ +15,5 @@ > + > +abstract class SelectionHandlerTest extends UITest { > + > + final protected String geckoEventString; > + final protected String url; final static private ?
Attachment #8565209 -
Flags: review?(markcapella) → feedback+
Assignee | ||
Comment 8•9 years ago
|
||
(In reply to Mark Capella [:capella] from comment #7) > Looks good! For a final optimization, can we unify the individual > geckoEventString values into a common "Robocop:testSelectionHandler" value. > (Move const TYPE_NAME to SelectionUtil ?) I'm not exactly sure how the geckoEventString is used but if you say it's safe to use a single string for all of the tests I'll do it. :) What do you mean by "move const TYPE_NAME to SelectionUtil"? Is TYPE_NAME the geckoEventString? > ::: mobile/android/base/tests/SelectionHandlerTest.java > @@ +15,5 @@ > > + > > +abstract class SelectionHandlerTest extends UITest { > > + > > + final protected String geckoEventString; > > + final protected String url; > > final static private ? If we make them final static we cannot assign them in the constructor. Making them private would mean we cannot use them in the extending classes if that's something that might be needed in the future.
Flags: needinfo?(markcapella)
Reporter | ||
Comment 9•9 years ago
|
||
Mmmmm ... i get my contributors mixed up ... This will involve a small bit of javascript ... Ping me in irc if this isn't enough of a clue http://mxr.mozilla.org/mozilla-central/search?string=TYPE_NAME&case=1&find=mobile.*.&findi=&filter=^[^\0]*%24&hitlimit=&tree=mozilla-central
Flags: needinfo?(markcapella)
Assignee | ||
Comment 10•9 years ago
|
||
I've hard-coded "Robocop:testSelectionHandler" into SelectionHandlerTest.java and SelectionUtils.js. I've also removed the TYPE_NAME definitions from the .html files and the geckoEventString constructor parameter from the .java files. I have run the three tests locally and did not notice any error.
Attachment #8565209 -
Attachment is obsolete: true
Attachment #8565470 -
Flags: review?(markcapella)
Reporter | ||
Comment 11•9 years ago
|
||
Comment on attachment 8565470 [details] [diff] [review] bug1125528_createAbstractSelectionHandlerTest.diff -v3 Review of attachment 8565470 [details] [diff] [review]: ----------------------------------------------------------------- Let's wrap it up! r+ from me assuming you'll tweak the nits, push to try and post here, and r? to margaret for final say-so. ::: mobile/android/base/tests/SelectionHandlerTest.java @@ +11,5 @@ > + > +/** > + * A base test class for selection handler tests. > + */ > + nit: unneeded blank line @@ +13,5 @@ > + * A base test class for selection handler tests. > + */ > + > +abstract class SelectionHandlerTest extends UITest { > + nit: unneeded @@ +14,5 @@ > + */ > + > +abstract class SelectionHandlerTest extends UITest { > + > + protected final String geckoEventString = "Robocop:testSelectionHandler"; private static final ... @@ +15,5 @@ > + > +abstract class SelectionHandlerTest extends UITest { > + > + protected final String geckoEventString = "Robocop:testSelectionHandler"; > + protected final String url; private final ...
Attachment #8565470 -
Flags: review?(markcapella) → review+
Assignee | ||
Comment 12•9 years ago
|
||
I've tweaked the nits. try: https://treeherder.mozilla.org/#/jobs?repo=try&revision=1a8589a6bd49
Attachment #8565470 -
Attachment is obsolete: true
Attachment #8565929 -
Flags: review?(margaret.leibovic)
Comment 13•9 years ago
|
||
Comment on attachment 8565929 [details] [diff] [review] bug1125528_createAbstractSelectionHandlerTest.diff -v4 Review of attachment 8565929 [details] [diff] [review]: ----------------------------------------------------------------- Looks good!
Attachment #8565929 -
Flags: review?(margaret.leibovic) → review+
Reporter | ||
Comment 14•9 years ago
|
||
Andy, do you want to mark this checkin neded?
Assignee | ||
Updated•9 years ago
|
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/94367d1c24b3
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
status-firefox39:
--- → fixed
Resolution: --- → FIXED
Whiteboard: [lang=java][fixed-in-fx-team] → [lang=java]
Target Milestone: --- → Firefox 39
Updated•3 years ago
|
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•