Closed Bug 903528 Opened 11 years ago Closed 11 years ago

Adapt services' JUnit unit testing framework to Fennec

Categories

(Firefox for Android Graveyard :: General, defect)

All
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 30

People

(Reporter: mcomella, Assigned: nalexander)

References

Details

Attachments

(5 files)

The android background services team has one test suite for unit testing, which runs locally on desktop, and another test suite for integration testing, which runs on Android devices. For mobile front-end, robocop serves the purpose of the integration test suite, however, the capabilities for unit testing are lacking. Bug 709353 will integrate services' JUnit testing framework into the automated testing systems - at that point, we should piggy-back on these efforts and adapt it to work for Fennec.
(In reply to Michael Comella (:mcomella) from comment #0) > The android background services team has one test suite for unit testing, > which runs locally on desktop, and another test suite for integration > testing, which runs on Android devices. To add some details: the unit testing suite is JUnit 4 and requires the Java runtime to execute; the integration testing suite is JUnit 3.
Note that bug 856614 is similar and perhaps should be duped.
Starting to track Fennec tests that would be 1/5 the size if implemented on JUnit: Bug 834033
WIP for mcomella.
Attachment #8375799 - Flags: feedback?(michael.l.comella)
This has already been reviewed by glandium; will carry-forward the r+.
This is a cautionary move: when uploaded to infrastructure, background.apk will not look so bad; but browser.apk is likely to confuse folks. (These files will be in the same directory as fennec-*apk, and sort earlier than that file.) I considered including "tests" in the name, but decided not to make a long name even longer. This also renames the Android package. This is purely cosmetic, since the package has no consumers (infrastructure, mach, etc). But this looks nicer in IDEs: the generated classes fit into the class hierarchy.
Attachment #8380226 - Flags: review?(rnewman)
The meat. Tested against my local device using Eclipse. Try build coming.
Attachment #8380227 - Flags: review?(rnewman)
Comment on attachment 8375799 [details] [diff] [review] Land and build Fennec JUnit 3 tests. r=mfinkle Assuming that I'm no longer needed here - reflag me if that's not the case.
Attachment #8375799 - Flags: feedback?(michael.l.comella)
Attachment #8380226 - Flags: review?(rnewman) → review+
Comment on attachment 8380227 [details] [diff] [review] Part 2: Land and build Fennec JUnit 3 tests. r=rnewman Review of attachment 8380227 [details] [diff] [review]: ----------------------------------------------------------------- LGTM, but consider whether you want these tests to be 2- or 4-spaced. You've got them as 2-spaced right now. ::: mobile/android/tests/browser/junit3/Makefile.in @@ +5,5 @@ > +ANDROID_APK_NAME := browser-junit3-debug > + > +ANDROID_EXTRA_JARS += \ > + browser-junit3.jar \ > + $(NULL) Indenting. ::: mobile/android/tests/browser/junit3/src/harness/BrowserInstrumentationTestRunner.java @@ +28,5 @@ > + Log.d(LOG_TAG, "getAndroidTestRunner"); > + AndroidTestRunner testRunner = super.getAndroidTestRunner(); > + testRunner.addTestListener(new BrowserTestListener()); > + return testRunner; > + } Indenting. ::: mobile/android/tests/browser/junit3/src/harness/BrowserTestListener.java @@ +14,5 @@ > + * <p> > + * The idea is that, on infrastructure, we'll be able to use the same test > + * parsing code for Browser JUnit 3 tests as we do for Robocop tests. > + * <p> > + * In future, that is! Bug filed for this?
Attachment #8380227 - Flags: review?(rnewman) → review+
Comment on attachment 8380228 [details] [diff] [review] Post: Add Eclipse project data to moz.build. r=rnewman Review of attachment 8380228 [details] [diff] [review]: ----------------------------------------------------------------- This is the most rubberstampy of rubberstamps.
Attachment #8380228 - Flags: review?(rnewman) → review+
Looks like my moz.build AndroidEclipse data needed to be bumped: https://hg.mozilla.org/integration/fx-team/rev/a7f45c95831d
Looks like there are some pre-existing build dependency problems that this patch tickles: https://hg.mozilla.org/integration/fx-team/rev/78e1e8346461
Depends on: 979064
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: