1717import javax .net .ssl .SSLContext ;
1818
1919import org .apache .commons .lang3 .SerializationUtils ;
20+ import org .htmlunit .WebClientOptions .Geolocation ;
2021import org .htmlunit .junit .BrowserRunner ;
2122import org .junit .Test ;
2223import org .junit .runner .RunWith ;
@@ -48,6 +49,9 @@ public void serialization() throws Exception {
4849 assertEquals (original .isThrowExceptionOnScriptError (), deserialized .isThrowExceptionOnScriptError ());
4950 assertEquals (original .isPopupBlockerEnabled (), deserialized .isPopupBlockerEnabled ());
5051 assertEquals (original .isRedirectEnabled (), deserialized .isRedirectEnabled ());
52+
53+ assertEquals (original .isGeolocationEnabled (), deserialized .isGeolocationEnabled ());
54+ assertEquals (original .getGeolocation (), deserialized .getGeolocation ());
5155 }
5256
5357 /**
@@ -65,6 +69,9 @@ public void serializationChanged() throws Exception {
6569 original .setPopupBlockerEnabled (true );
6670 original .setRedirectEnabled (false );
6771
72+ original .setGeolocationEnabled (true );
73+ original .setGeolocation (new WebClientOptions .Geolocation (1d , 2d , 3d , 4d , 5d , 6d , 7d ));
74+
6875 final byte [] bytes = SerializationUtils .serialize (original );
6976 final WebClientOptions deserialized = (WebClientOptions ) SerializationUtils .deserialize (bytes );
7077
@@ -77,6 +84,16 @@ public void serializationChanged() throws Exception {
7784 assertEquals (original .isThrowExceptionOnScriptError (), deserialized .isThrowExceptionOnScriptError ());
7885 assertEquals (original .isPopupBlockerEnabled (), deserialized .isPopupBlockerEnabled ());
7986 assertEquals (original .isRedirectEnabled (), deserialized .isRedirectEnabled ());
87+
88+ assertEquals (original .isGeolocationEnabled (), deserialized .isGeolocationEnabled ());
89+ assertEquals (original .getGeolocation ().getAccuracy (), deserialized .getGeolocation ().getAccuracy ());
90+ assertEquals (original .getGeolocation ().getLatitude (), deserialized .getGeolocation ().getLatitude ());
91+ assertEquals (original .getGeolocation ().getLongitude (), deserialized .getGeolocation ().getLongitude ());
92+ assertEquals (original .getGeolocation ().getAltitude (), deserialized .getGeolocation ().getAltitude ());
93+ assertEquals (original .getGeolocation ().getAltitudeAccuracy (),
94+ deserialized .getGeolocation ().getAltitudeAccuracy ());
95+ assertEquals (original .getGeolocation ().getHeading (), deserialized .getGeolocation ().getHeading ());
96+ assertEquals (original .getGeolocation ().getSpeed (), deserialized .getGeolocation ().getSpeed ());
8097 }
8198
8299 /**
0 commit comments