Basic tests for GeckoProfile

RESOLVED FIXED in Firefox 34

Status

()

defect
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: wesj, Assigned: wesj)

Tracking

unspecified
Firefox 34
All
Android
Points:
---
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

I want to change GeckoProfile a bit. Before I do, I'd like some tests in place.
Posted 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
https://hg.mozilla.org/mozilla-central/rev/d9ea224d0ebc
Assignee: nobody → wjohnston
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → Firefox 34
You need to log in before you can comment on or make changes to this bug.