Skip to content

Commit

Permalink
Clean up some stylistic nits. No logical changes
Browse files Browse the repository at this point in the history
  • Loading branch information
shs96c committed Sep 28, 2021
1 parent 12a14a2 commit c62dbf9
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
16 changes: 11 additions & 5 deletions java/src/org/openqa/selenium/chromium/AddHasCasting.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,27 +51,33 @@ public Class<HasCasting> getDescribedInterface() {
@Override
public HasCasting getImplementation(Capabilities capabilities, ExecuteMethod executeMethod) {
return new HasCasting() {
@Override public List<Map<String, String>> getCastSinks() {
@SuppressWarnings("unchecked")
@Override
public List<Map<String, String>> getCastSinks() {
return (List<Map<String, String>>) executeMethod.execute(GET_CAST_SINKS, null);
}

@Override public void selectCastSink(String deviceName) {
@Override
public void selectCastSink(String deviceName) {
Require.nonNull("Device Name", deviceName);

executeMethod.execute(SET_CAST_SINK_TO_USE, ImmutableMap.of("sinkName", deviceName));
}

@Override public void startTabMirroring(String deviceName) {
@Override
public void startTabMirroring(String deviceName) {
Require.nonNull("Device Name", deviceName);

executeMethod.execute(START_CAST_TAB_MIRRORING, ImmutableMap.of("sinkName", deviceName));
}

@Override public String getCastIssueMessage() {
@Override
public String getCastIssueMessage() {
return executeMethod.execute(GET_CAST_ISSUE_MESSAGE, null).toString();
}

@Override public void stopCasting(String deviceName) {
@Override
public void stopCasting(String deviceName) {
Require.nonNull("Device Name", deviceName);

executeMethod.execute(STOP_CASTING, ImmutableMap.of("sinkName", deviceName));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ public class AddHasNetworkConditions implements AugmenterProvider<HasNetworkCond


private static final Map<String, CommandInfo> COMMANDS = ImmutableMap.of(
GET_NETWORK_CONDITIONS, new CommandInfo("/session/:sessionId/chromium/network_conditions",HttpMethod.GET),
SET_NETWORK_CONDITIONS, new CommandInfo("/session/:sessionId/chromium/network_conditions",HttpMethod.POST),
GET_NETWORK_CONDITIONS, new CommandInfo("/session/:sessionId/chromium/network_conditions", HttpMethod.GET),
SET_NETWORK_CONDITIONS, new CommandInfo("/session/:sessionId/chromium/network_conditions", HttpMethod.POST),
DELETE_NETWORK_CONDITIONS, new CommandInfo("/session/:sessionId/chromium/network_conditions", HttpMethod.DELETE));

@Override
Expand All @@ -66,6 +66,7 @@ public HasNetworkConditions getImplementation(Capabilities capabilities, Execute
return new HasNetworkConditions() {
@Override
public ChromiumNetworkConditions getNetworkConditions() {
@SuppressWarnings("unchecked")
Map<String, Object> result = (Map<String, Object>) executeMethod.execute(GET_NETWORK_CONDITIONS, null);
ChromiumNetworkConditions networkConditions = new ChromiumNetworkConditions();
networkConditions.setOffline((Boolean) result.getOrDefault(ChromiumNetworkConditions.OFFLINE, false));
Expand Down
2 changes: 1 addition & 1 deletion java/src/org/openqa/selenium/chromium/HasCdp.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@ public interface HasCdp {
* @param parameters any information needed to execute the Dev Tools command.
* @return the name and value of the response.
*/
public Map<String, Object> executeCdpCommand(String commandName, Map<String, Object> parameters);
Map<String, Object> executeCdpCommand(String commandName, Map<String, Object> parameters);
}

0 comments on commit c62dbf9

Please sign in to comment.