Closed Bug 1045274 Opened 11 years ago Closed 11 years ago

Basic tests for GeckoProfile

Categories

(Firefox for Android Graveyard :: Testing, defect)

All
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 34

People

(Reporter: wesj, Assigned: wesj)

Details

Attachments

(1 file)

I want to change GeckoProfile a bit. Before I do, I'd like some tests in place.
Attached patch Patch v1Splinter Review
My attempt to push this to try is still spinning. These pass locally, and give a good idea of the different behaviours of the getters.
Attachment #8464218 - Flags: review?(rnewman)
Comment on attachment 8464218 [details] [diff] [review] Patch v1 Review of attachment 8464218 [details] [diff] [review]: ----------------------------------------------------------------- Huge thanks for writing tests for this :D ::: mobile/android/base/GeckoProfile.java @@ +33,5 @@ > > // Used to "lock" the guest profile, so that we'll always restart in it > private static final String LOCK_FILE_NAME = ".active_lock"; > public static final String DEFAULT_PROFILE = "default"; > + public static final String GUEST_PROFILE = "guest"; @RobocopTarget ::: mobile/android/base/GeckoProfileDirectories.java @@ +78,5 @@ > /** > * Package-scoped because GeckoProfile needs to dig into this in order to do writes. > * This will be fixed in Bug 975212. > */ > + public static INIParser getProfilesINI(File mozillaDir) { Need to correct comment above. @RobocopTarget, too. @@ +115,5 @@ > * @return a new File object for the Mozilla directory. > * @throws NoMozillaDirectoryException > * if the directory did not exist and could not be created. > */ > + public static File getMozillaDirectory(Context context) throws NoMozillaDirectoryException { @RobocopTarget ::: mobile/android/base/tests/testGeckoProfile.java @@ +1,1 @@ > +package org.mozilla.gecko.tests; License. @@ +246,5 @@ > + > + mAsserter.is(found, shouldFind, "Found profile where expected"); > + } > + > + // Tries to remove a profile from Gecko profile. Verifies that its removed from profiles.ini and its directory is deleted. it's removed @@ +256,5 @@ > + mAsserter.ok(!dir.exists(), "Profile dir was deleted when it was removed", dir.toString()); > + findInProfilesIni(profile, false); > + } > + > + // Looks for a dir who's name ends with the passed in string. whose, passed-in
Attachment #8464218 - Flags: review?(rnewman) → review+
Status: NEW → ASSIGNED
Component: General → Testing
OS: Linux → Android
Hardware: x86_64 → All
Assignee: nobody → wjohnston
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → Firefox 34
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: