Skip to content

Commit 27cd744

Browse files
committed
convert enums
1 parent 741d262 commit 27cd744

File tree

1 file changed

+1
-16
lines changed

1 file changed

+1
-16
lines changed

playwright/src/main/java/com/microsoft/playwright/impl/BrowserContextImpl.java

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -542,24 +542,9 @@ private void routeWebSocketImpl(UrlMatcher matcher, Consumer<WebSocketRoute> han
542542
});
543543
}
544544

545-
private HarContentPolicy routeFromHarUpdateContentPolicyToHarContentPolicy(RouteFromHarUpdateContentPolicy contentPolicy) {
546-
if (contentPolicy == null) {
547-
return null;
548-
}
549-
550-
switch (contentPolicy) {
551-
case ATTACH:
552-
return HarContentPolicy.ATTACH;
553-
case EMBED:
554-
return HarContentPolicy.EMBED;
555-
default:
556-
return null;
557-
}
558-
}
559-
560545
void recordIntoHar(PageImpl page, Path har, RouteFromHAROptions options, HarContentPolicy contentPolicy) {
561546
if (contentPolicy == null) {
562-
contentPolicy = routeFromHarUpdateContentPolicyToHarContentPolicy(options.updateContent);
547+
contentPolicy = Utils.convertType(options.updateContent, HarContentPolicy.class);;
563548
}
564549
if (contentPolicy == null) {
565550
contentPolicy = HarContentPolicy.ATTACH;

0 commit comments

Comments
 (0)