Skip to content

Commit 8aed1e7

Browse files
committed
Adding more tests for FirefoxProfile
1 parent ba5de5f commit 8aed1e7

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

java/client/test/org/openqa/selenium/firefox/FirefoxProfileTest.java

+19
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
import static org.junit.Assert.assertEquals;
3737
import static org.junit.Assert.assertNotNull;
3838
import static org.junit.Assert.assertTrue;
39+
import static org.junit.Assert.fail;
3940

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

108+
@Test
109+
public void shouldSetDefaultPreferences() throws Exception {
110+
assertPreferenceValueEquals("network.http.phishy-userpass-length", 255);
111+
}
112+
113+
@Test
114+
115+
public void shouldNotResetFrozenPreferences() throws Exception {
116+
try {
117+
profile.setPreference("network.http.phishy-userpass-length", 1024);
118+
fail("Should not be able to reset a frozen preference");
119+
} catch (IllegalArgumentException ex) {
120+
// expected
121+
}
122+
123+
assertPreferenceValueEquals("network.http.phishy-userpass-length", 255);
124+
}
125+
107126
@Test
108127
public void shouldInstallExtensionFromZip() throws IOException {
109128
FirefoxProfile profile = new FirefoxProfile();

0 commit comments

Comments
 (0)