Skip to content

Commit

Permalink
simple test for browser creation with a different itmezone
Browse files Browse the repository at this point in the history
  • Loading branch information
rbri committed May 18, 2024
1 parent 0e62935 commit 2c85fe6
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/test/java/org/htmlunit/BrowserVersionTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertTrue;

import java.util.TimeZone;

import org.junit.Test;

/**
Expand Down Expand Up @@ -67,4 +70,22 @@ public void testClone() {
assertTrue(clone.getPlugins().isEmpty());
assertFalse(ff.getPlugins().isEmpty());
}

/**
* Test of BrowserVersion.BrowserVersionBuilder.
*/
@Test
public void differentTimeZone() {
final BrowserVersion ffBerlin = new BrowserVersion.BrowserVersionBuilder(BrowserVersion.FIREFOX)
.setSystemTimezone(TimeZone.getTimeZone("Europe/Berlin"))
.build();

// Nickname is used as key for dictionaries storing browser setups
assertTrue(BrowserVersion.FIREFOX.getNickname().equals(ffBerlin.getNickname()));

assertFalse(BrowserVersion.FIREFOX == ffBerlin);
assertFalse(BrowserVersion.FIREFOX.equals(ffBerlin));

assertNotEquals(BrowserVersion.FIREFOX.getSystemTimezone(), ffBerlin.getSystemTimezone());
}
}

0 comments on commit 2c85fe6

Please sign in to comment.