-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enrich Target GCD #7285
Enrich Target GCD #7285
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the PR! The only comments I have are nits: there's no reason not to merge this and fix in place. :)
@@ -25,6 +25,7 @@ | |||
import com.google.common.collect.ImmutableMap; | |||
import com.google.common.collect.Multimap; | |||
|
|||
import org.openqa.selenium.devtools.target.model.SessionId; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It fills me with endless sadness that we can't use Selenium's own SessionId
here.
@@ -57,24 +63,26 @@ public void close() { | |||
|
|||
public void createSession() { | |||
// Figure out the targets. | |||
Set<Target.TargetInfo> infos = connection.sendAndWait(cdpSession, Target.getTargets(), timeout); | |||
List<TargetInfo> infos = connection.sendAndWait(cdpSession, Target.getTargets(), timeout); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ordering of targets doesn't matter, and we don't allow duplicates. Set
is the right collection type to use.
} | ||
|
||
/** | ||
* nject object to the target's main frame that provides a communication channel with browser |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: missing first letter.
|
||
/** | ||
* Creates a new empty BrowserContext. Similar to an incognito profile but you can have more than | ||
* one.EXPERIMENTAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: the beta annotation shows that this is experimental.
String url, | ||
Optional<Integer> width, | ||
Optional<Integer> height, | ||
Optional<BrowserContextID> browserContextID, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: BrowserContextId
is preferable, and more in keeping with the naming conventions used in selenium.
* automatically detaches from all currently attached targets.EXPERIMENTAL | ||
*/ | ||
public static Command<Void> setAutoAttach( | ||
Boolean autoAttach, Boolean waitForDebuggerOnStart, Optional<Boolean> flatten) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can clean this up in a later pass, but we can use primitives for parameters that are required. boolean
, as we do elsewhere.
Summary :
Enrich DevTools Target API according to Google documentation
Features:
X
in the preceding checkbox, I verify that I have signed the Contributor License Agreement