Skip to content

Commit

Permalink
Adding more tests for FirefoxProfile
Browse files Browse the repository at this point in the history
  • Loading branch information
barancev committed Oct 29, 2014
1 parent ba5de5f commit 8aed1e7
Showing 1 changed file with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;

public class FirefoxProfileTest {
private static final String FIREBUG_PATH = "third_party/firebug/firebug-1.5.0-fx.xpi";
Expand Down Expand Up @@ -104,6 +105,24 @@ public void shouldSetBooleanPreferences() throws Exception {
assertPreferenceValueEquals("cheese", false);
}

@Test
public void shouldSetDefaultPreferences() throws Exception {
assertPreferenceValueEquals("network.http.phishy-userpass-length", 255);
}

@Test

public void shouldNotResetFrozenPreferences() throws Exception {
try {
profile.setPreference("network.http.phishy-userpass-length", 1024);
fail("Should not be able to reset a frozen preference");
} catch (IllegalArgumentException ex) {
// expected
}

assertPreferenceValueEquals("network.http.phishy-userpass-length", 255);
}

@Test
public void shouldInstallExtensionFromZip() throws IOException {
FirefoxProfile profile = new FirefoxProfile();
Expand Down

0 comments on commit 8aed1e7

Please sign in to comment.