Don't allow modification of `ChromeOptions` as a map
But do allow null values in capabilities.
import java.io.File;
import java.io.IOException;
import java.util.Base64;
+import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
@@ -241,6 +242,6 @@ MutableCapabilities toCapabilities() {
toReturn.put(CAPABILITY, options);
- return toReturn;
+ return Collections.unmodifiableMap(toReturn);
}
}
